2 # Check if we have a working fadvise system call
4 AC_DEFUN([AC_HAVE_FADVISE],
5 [ AC_MSG_CHECKING([for fadvise ])
8 #define _FILE_OFFSET_BITS 64
11 posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
15 AC_SUBST(have_fadvise)
19 # Check if we have a working madvise system call
21 AC_DEFUN([AC_HAVE_MADVISE],
22 [ AC_MSG_CHECKING([for madvise ])
25 #define _FILE_OFFSET_BITS 64
28 posix_madvise(0, 0, MADV_NORMAL);
32 AC_SUBST(have_madvise)
36 # Check if we have a working mincore system call
38 AC_DEFUN([AC_HAVE_MINCORE],
39 [ AC_MSG_CHECKING([for mincore ])
42 #define _FILE_OFFSET_BITS 64
49 AC_SUBST(have_mincore)
53 # Check if we have a working sendfile system call
55 AC_DEFUN([AC_HAVE_SENDFILE],
56 [ AC_MSG_CHECKING([for sendfile ])
59 #define _FILE_OFFSET_BITS 64
60 #include <sys/sendfile.h>
66 AC_SUBST(have_sendfile)
70 # Check if we have a getmntent libc call (IRIX, Linux)
72 AC_DEFUN([AC_HAVE_GETMNTENT],
73 [ AC_MSG_CHECKING([for getmntent ])
82 AC_SUBST(have_getmntent)
86 # Check if we have a getmntinfo libc call (FreeBSD, Mac OS X)
88 AC_DEFUN([AC_HAVE_GETMNTINFO],
89 [ AC_MSG_CHECKING([for getmntinfo ])
91 #include <sys/param.h>
92 #include <sys/ucred.h>
93 #include <sys/mount.h>
96 ], have_getmntinfo=yes
99 AC_SUBST(have_getmntinfo)
103 # Check if we have a fallocate libc call (Linux)
105 AC_DEFUN([AC_HAVE_FALLOCATE],
106 [ AC_MSG_CHECKING([for fallocate])
109 #define _FILE_OFFSET_BITS 64
111 #include <linux/falloc.h>
113 fallocate(0, 0, 0, 0);
114 ], have_fallocate=yes
117 AC_SUBST(have_fallocate)
121 # Check if we have the fiemap ioctl (Linux)
123 AC_DEFUN([AC_HAVE_FIEMAP],
124 [ AC_MSG_CHECKING([for fiemap])
127 #define _FILE_OFFSET_BITS 64
128 #include <linux/fs.h>
129 #include <linux/fiemap.h>
131 struct fiemap *fiemap;
132 ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap);
136 AC_SUBST(have_fiemap)
140 # Check if we have a preadv libc call (Linux)
142 AC_DEFUN([AC_HAVE_PREADV],
143 [ AC_MSG_CHECKING([for preadv])
145 #define _FILE_OFFSET_BITS 64
153 AC_SUBST(have_preadv)
157 # Check if we have a sync_file_range libc call (Linux)
159 AC_DEFUN([AC_HAVE_SYNC_FILE_RANGE],
160 [ AC_MSG_CHECKING([for sync_file_range])
163 #define _FILE_OFFSET_BITS 64
166 sync_file_range(0, 0, 0, 0);
167 ], have_sync_file_range=yes
170 AC_SUBST(have_sync_file_range)
174 # Check if we have a syncfs libc call (Linux)
176 AC_DEFUN([AC_HAVE_SYNCFS],
177 [ AC_MSG_CHECKING([for syncfs])
180 #define _FILE_OFFSET_BITS 64
187 AC_SUBST(have_syncfs)
191 # Check if we have a readdir libc call
193 AC_DEFUN([AC_HAVE_READDIR],
194 [ AC_MSG_CHECKING([for readdir])
202 AC_SUBST(have_readdir)