… | |
… | |
43 | return 0; |
43 | return 0; |
44 | } |
44 | } |
45 | ],ac_cv_preadwrite=yes,ac_cv_preadwrite=no)]) |
45 | ],ac_cv_preadwrite=yes,ac_cv_preadwrite=no)]) |
46 | test $ac_cv_preadwrite = yes && AC_DEFINE(HAVE_PREADWRITE, 1, pread(2) and pwrite(2) are available) |
46 | test $ac_cv_preadwrite = yes && AC_DEFINE(HAVE_PREADWRITE, 1, pread(2) and pwrite(2) are available) |
47 | |
47 | |
|
|
48 | AC_CACHE_CHECK(for sendfile, ac_cv_sendfile, [AC_LINK_IFELSE([ |
|
|
49 | # include <sys/types.h> |
|
|
50 | #if __linux |
|
|
51 | # include <sys/sendfile.h> |
|
|
52 | #elif __freebsd |
|
|
53 | # include <sys/socket.h> |
|
|
54 | # include <sys/uio.h> |
|
|
55 | #elif __hpux |
|
|
56 | # include <sys/socket.h> |
|
|
57 | #endif |
|
|
58 | int main(void) |
|
|
59 | { |
|
|
60 | int fd = 0; |
|
|
61 | off_t offset = 1; |
|
|
62 | size_t count = 2; |
|
|
63 | ssize_t res; |
|
|
64 | #if __linux |
|
|
65 | res = sendfile (fd, fd, offset, count); |
|
|
66 | #elif __freebsd |
|
|
67 | res = sendfile (fd, fd, offset, count, 0, &offset, 0); |
|
|
68 | #elif __hpux |
|
|
69 | res = sendfile (fd, fd, offset, count, 0, 0); |
|
|
70 | #endif |
|
|
71 | return 0; |
|
|
72 | } |
|
|
73 | ],ac_cv_sendfile=yes,ac_cv_sendfile=no)]) |
|
|
74 | test $ac_cv_sendfile = yes && AC_DEFINE(HAVE_SENDFILE, 1, sendfile(2) is available and supported) |
|
|
75 | |
48 | AC_OUTPUT |
76 | AC_OUTPUT |