summaryrefslogtreecommitdiffhomepage
path: root/auto/sendfile
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2020-03-17 14:44:06 +0300
committerMax Romanov <max.romanov@nginx.com>2020-03-17 14:44:06 +0300
commitefbcd517fc9ec1ef5a6dfe85cb79bf0a57b954c5 (patch)
tree754067aa481e2eda98db97f9c40cb3a20d8181b3 /auto/sendfile
parentb7f0e09de00e3a477f7708223c3db4ed05ab97cd (diff)
downloadunit-efbcd517fc9ec1ef5a6dfe85cb79bf0a57b954c5.tar.gz
unit-efbcd517fc9ec1ef5a6dfe85cb79bf0a57b954c5.tar.bz2
Checking sendfile() availability in configure.
Removing SF_NODISKIO flag for FreeBSD sendfile() check because it is not used yet and to support DragonFlyBSD. This closes #414 issue on GitHub.
Diffstat (limited to '')
-rw-r--r--auto/sendfile56
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