mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
HPUX sendfile is now detected correctly.
Jeremy.
(This used to be commit 91e41ebe97
)
This commit is contained in:
parent
aad3c35ac1
commit
994638f577
@ -228,5 +228,5 @@
|
||||
#undef LINUX_BROKEN_SENDFILE_API
|
||||
#undef WITH_SENDFILE
|
||||
#undef FREEBSD_SENDFILE_API
|
||||
#undef HPUX_SENDFILE_API
|
||||
#undef WITH_ADS
|
||||
|
||||
|
1824
source3/configure
vendored
1824
source3/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -2793,7 +2793,61 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
|
||||
AC_MSG_RESULT(no);
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
|
||||
*hpux*)
|
||||
AC_CACHE_CHECK([for hpux sendfile64 support],samba_cv_HAVE_SENDFILE64,[
|
||||
AC_TRY_LINK([\
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>],
|
||||
[\
|
||||
int fromfd, tofd;
|
||||
size_t total=0;
|
||||
struct iovec hdtrl[2];
|
||||
ssize_t nwritten;
|
||||
off64_t offset;
|
||||
|
||||
hdtrl[0].iov_base = 0;
|
||||
hdtrl[0].iov_len = 0;
|
||||
|
||||
nwritten = sendfile64(tofd, fromfd, offset, total, &hdtrl[0], 0);
|
||||
],
|
||||
samba_cv_HAVE_SENDFILE64=yes,samba_cv_HAVE_SENDFILE64=no)])
|
||||
if test x"$samba_cv_HAVE_SENDFILE64" = x"yes"; then
|
||||
AC_DEFINE(HAVE_SENDFILE64)
|
||||
AC_DEFINE(HPUX_SENDFILE_API)
|
||||
AC_DEFINE(WITH_SENDFILE)
|
||||
else
|
||||
AC_MSG_RESULT(no);
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for hpux sendfile support],samba_cv_HAVE_SENDFILE,[
|
||||
AC_TRY_LINK([\
|
||||
#include <sys/socket.h>
|
||||
#include <sys/uio.h>],
|
||||
[\
|
||||
int fromfd, tofd;
|
||||
size_t total=0;
|
||||
struct iovec hdtrl[2];
|
||||
ssize_t nwritten;
|
||||
off_t offset;
|
||||
|
||||
hdtrl[0].iov_base = 0;
|
||||
hdtrl[0].iov_len = 0;
|
||||
|
||||
nwritten = sendfile(tofd, fromfd, offset, total, &hdtrl[0], 0);
|
||||
],
|
||||
samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
|
||||
if test x"$samba_cv_HAVE_SENDFILE" = x"yes"; then
|
||||
AC_DEFINE(HAVE_SENDFILE)
|
||||
AC_DEFINE(HPUX_SENDFILE_API)
|
||||
AC_DEFINE(WITH_SENDFILE)
|
||||
else
|
||||
AC_MSG_RESULT(no);
|
||||
fi
|
||||
|
||||
;;
|
||||
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
|
||||
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
@ -294,6 +294,7 @@
|
||||
#undef LINUX_BROKEN_SENDFILE_API
|
||||
#undef WITH_SENDFILE
|
||||
#undef FREEBSD_SENDFILE_API
|
||||
#undef HPUX_SENDFILE_API
|
||||
#undef WITH_ADS
|
||||
|
||||
/* The number of bytes in a int. */
|
||||
|
@ -209,7 +209,8 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
|
||||
hdtrl[0].iov_len = 0;
|
||||
} else {
|
||||
nwritten = 0;
|
||||
hdtrl[0].iov_base += nwritten;
|
||||
/* iov_base is defined as a void *... */
|
||||
hdtrl[0].iov_base = ((char *)hdtrl[0].iov_base) + nwritten;
|
||||
hdtrl[0].iov_len -= nwritten;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user