sendfile-util.c revision 2efdf9871cb3bec7a221513526641ca83fa3728f
/* 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 {
/* out_fd wasn't a socket. behave as if sendfile()
wasn't supported at all. */
}
return -1;
}
}
#elif defined (HAVE_SOLARIS_SENDFILEV)
#include <sys/sendfile.h>
{
struct sendfilevec vec;
else
return -1;
}
#else
{
return -1;
}
#endif