sendfile-util.c revision 55941eeb02253dbff768222a47c911ae6fd8690a
/* kludge a bit to remove _FILE_OFFSET_BITS definition from config.h.
It's required to be able to include sys/sendfile.h with Linux. */
#include "../../config.h"
#ifdef HAVE_LINUX_SENDFILE
#endif
#include "lib.h"
#include "sendfile-util.h"
#ifdef HAVE_LINUX_SENDFILE
#include <sys/sendfile.h>
{
/* REMEBER: uoff_t and off_t may not be of same size. */
/* make sure given offset fits into off_t */
/* 32bit off_t */
if (*offset > 2147483647L) {
return -1;
}
} else {
/* they're most likely the same size. if not, fix this
code later */
return -1;
}
}
return ret;
}
#elif defined(HAVE_FREEBSD_SENDFILE)
{
int ret;
else
return -1;
}
#else
{
return -1;
}
#endif