diff options
Diffstat (limited to 'auto/sendfile')
-rw-r--r-- | auto/sendfile | 56 |
1 files changed, 32 insertions, 24 deletions
diff --git a/auto/sendfile b/auto/sendfile index e5bf3b79..a065f7b6 100644 --- a/auto/sendfile +++ b/auto/sendfile @@ -46,7 +46,7 @@ if [ $nxt_found = no ]; then int main() { off_t sent; - sendfile(-1, -1, 0, 0, NULL, &sent, SF_NODISKIO); + sendfile(-1, -1, 0, 0, NULL, &sent, 0); return 0; }" . auto/feature @@ -57,55 +57,63 @@ if [ $nxt_found = no ]; then fi -NXT_LIBSENDFILE= - if [ $nxt_found = no ]; then - # Solaris 8 sendfilev(). + # MacOSX sendfile(). - nxt_feature="Solaris sendfilev()" - nxt_feature_name=NXT_HAVE_SOLARIS_SENDFILEV - nxt_feature_libs="-lsendfile" - nxt_feature_test="#include <sys/sendfile.h> + nxt_feature="MacOSX sendfile()" + nxt_feature_name=NXT_HAVE_MACOSX_SENDFILE + nxt_feature_libs= + nxt_feature_test="#include <sys/types.h> + #include <sys/socket.h> + #include <sys/uio.h> + #include <stdlib.h> int main() { - size_t sent; - struct sendfilevec vec; + off_t sent; - sendfilev(-1, &vec, 0, &sent); + sendfile(-1, -1, 0, &sent, NULL, 0); return 0; }" . auto/feature if [ $nxt_found = yes ]; then - NXT_HAVE_SOLARIS_SENDFILEV=YES - NXT_LIBSENDFILE=$nxt_feature_libs + NXT_HAVE_MACOSX_SENDFILE=YES fi fi if [ $nxt_found = no ]; then + $echo + $echo "$0: error: no supported sendfile() found." + $echo + exit 1; +fi - # MacOSX sendfile(). - nxt_feature="MacOSX sendfile()" - nxt_feature_name=NXT_HAVE_MACOSX_SENDFILE - nxt_feature_libs= - nxt_feature_test="#include <sys/types.h> - #include <sys/socket.h> - #include <sys/uio.h> - #include <stdlib.h> +NXT_LIBSENDFILE= + +if [ $nxt_found = no ]; then + + # Solaris 8 sendfilev(). + + nxt_feature="Solaris sendfilev()" + nxt_feature_name=NXT_HAVE_SOLARIS_SENDFILEV + nxt_feature_libs="-lsendfile" + nxt_feature_test="#include <sys/sendfile.h> int main() { - off_t sent; + size_t sent; + struct sendfilevec vec; - sendfile(-1, -1, 0, &sent, NULL, 0); + sendfilev(-1, &vec, 0, &sent); return 0; }" . auto/feature if [ $nxt_found = yes ]; then - NXT_HAVE_MACOSX_SENDFILE=YES + NXT_HAVE_SOLARIS_SENDFILEV=YES + NXT_LIBSENDFILE=$nxt_feature_libs fi fi |