+#if HAVE_LINUX_SENDFILE
+ /* check that sendfile() is really implemented (same check as configure does) */
+ {
+ int out_fd = 1, in_fd = 0;
+ off_t offset = 0;
+ size_t size = 1024;
+
+ errno = 0;
+ sendfile(out_fd, in_fd, &offset, size);
+ if (errno == ENOSYS) sendfile_supported = 0;
+ }
+#endif
+