| 1 |
root |
1.1 |
AC_PREREQ(2.59) |
| 2 |
|
|
AC_INIT |
| 3 |
|
|
AC_CONFIG_HEADERS([config.h]) |
| 4 |
|
|
|
| 5 |
|
|
AC_PROG_CC |
| 6 |
|
|
|
| 7 |
|
|
AC_CACHE_CHECK(for readahead, ac_cv_readahead, [AC_LINK_IFELSE([ |
| 8 |
|
|
#include <fcntl.h> |
| 9 |
|
|
int main(void) |
| 10 |
|
|
{ |
| 11 |
|
|
int fd = 0; |
| 12 |
|
|
off64_t offset = 1; |
| 13 |
|
|
size_t count = 2; |
| 14 |
|
|
ssize_t res; |
| 15 |
|
|
res = readahead (fd, offset, count); |
| 16 |
|
|
return 0; |
| 17 |
|
|
} |
| 18 |
|
|
],ac_cv_readahead=yes,ac_cv_readahead=no)]) |
| 19 |
|
|
test $ac_cv_readahead = yes && AC_DEFINE(HAVE_READAHEAD, 1, readahead(2) is available (linux)) |
| 20 |
|
|
|
| 21 |
|
|
AC_CACHE_CHECK(for fdatasync, ac_cv_fdatasync, [AC_LINK_IFELSE([ |
| 22 |
|
|
#include <unistd.h> |
| 23 |
|
|
int main(void) |
| 24 |
|
|
{ |
| 25 |
|
|
int fd = 0; |
| 26 |
|
|
fdatasync (fd); |
| 27 |
|
|
return 0; |
| 28 |
|
|
} |
| 29 |
|
|
],ac_cv_fdatasync=yes,ac_cv_fdatasync=no)]) |
| 30 |
|
|
test $ac_cv_fdatasync = yes && AC_DEFINE(HAVE_FDATASYNC, 1, fdatasync(2) is available) |
| 31 |
|
|
|
| 32 |
|
|
AC_CACHE_CHECK(for pread and pwrite, ac_cv_preadwrite, [AC_LINK_IFELSE([ |
| 33 |
|
|
#include <unistd.h> |
| 34 |
|
|
int main(void) |
| 35 |
|
|
{ |
| 36 |
|
|
int fd = 0; |
| 37 |
|
|
size_t count = 1; |
| 38 |
|
|
char buf; |
| 39 |
|
|
off_t offset = 1; |
| 40 |
|
|
ssize_t res; |
| 41 |
|
|
res = pread (fd, &buf, count, offset); |
| 42 |
|
|
res = pwrite (fd, &buf, count, offset); |
| 43 |
|
|
return 0; |
| 44 |
|
|
} |
| 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) |
| 47 |
|
|
|
| 48 |
|
|
AC_OUTPUT |