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.
This commit is contained in:
Max Romanov
2020-03-17 14:44:06 +03:00
parent b7f0e09de0
commit efbcd517fc

View File

@@ -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,33 +57,6 @@ if [ $nxt_found = no ]; then
fi
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() {
size_t sent;
struct sendfilevec vec;
sendfilev(-1, &vec, 0, &sent);
return 0;
}"
. auto/feature
if [ $nxt_found = yes ]; then
NXT_HAVE_SOLARIS_SENDFILEV=YES
NXT_LIBSENDFILE=$nxt_feature_libs
fi
fi
if [ $nxt_found = no ]; then
# MacOSX sendfile().
@@ -110,6 +83,41 @@ if [ $nxt_found = no ]; then
fi
if [ $nxt_found = no ]; then
$echo
$echo "$0: error: no supported sendfile() found."
$echo
exit 1;
fi
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() {
size_t sent;
struct sendfilevec vec;
sendfilev(-1, &vec, 0, &sent);
return 0;
}"
. auto/feature
if [ $nxt_found = yes ]; then
NXT_HAVE_SOLARIS_SENDFILEV=YES
NXT_LIBSENDFILE=$nxt_feature_libs
fi
fi
if [ $nxt_found = no ]; then
# AIX send_file().