sendfile-util.c revision 02916b7a6829986385210aeaedfd74f53b6761d6
/* 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>
#include "network.h"
{
struct sendfilevec vec;
/* outfd must be socket, or at least some Solaris versions will
kernel panic */
return -1;
}
else
return -1;
}
#else
{
return -1;
}
#endif