3 dnl posix_allocate() function detection
6 AC_DEFUN([gl_POSIX_FALLOCATE], [
7 dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it.
9 #define _XOPEN_SOURCE 600
11 #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7)
12 possibly broken posix_fallocate
15 [posix_fallocate(0, 0, 0);],
17 [HAVE_POSIX_FALLOCATE],
19 [Define if you have a working posix_fallocate()])
24 dnl Get from the coreutils package (stat-prog.m4 serial 7)
27 AC_DEFUN([mc_cu_PREREQ_STAT_PROG],
29 AC_REQUIRE([gl_FSUSAGE])
30 AC_REQUIRE([gl_FSTYPENAME])
31 AC_CHECK_HEADERS_ONCE([OS.h netinet/in.h sys/param.h sys/vfs.h])
33 dnl Check for vfs.h first, since this avoids a warning with nfs_client.h
35 test $ac_cv_header_sys_param_h = yes &&
36 test $ac_cv_header_sys_mount_h = yes &&
37 AC_CHECK_HEADERS([nfs/vfs.h],
38 [AC_CHECK_HEADERS([nfs/nfs_client.h])])
42 #include <sys/statvfs.h>
48 #elif defined HAVE_SYS_MOUNT_H && defined HAVE_SYS_PARAM_H
49 # include <sys/param.h>
50 # include <sys/mount.h>
51 # if defined HAVE_NETINET_IN_H && defined HAVE_NFS_NFS_CLNT_H && defined HAVE_NFS_VFS_H
52 # include <netinet/in.h>
53 # include <nfs/nfs_clnt.h>
56 #elif defined HAVE_OS_H
60 if case "$fu_cv_sys_stat_statvfs$fu_cv_sys_stat_statvfs64" in
61 *yes*) ;; *) false;; esac &&
62 { AC_CHECK_MEMBERS([struct statvfs.f_basetype],,, [$statvfs_includes])
63 test $ac_cv_member_struct_statvfs_f_basetype = yes ||
64 { AC_CHECK_MEMBERS([struct statvfs.f_fstypename],,, [$statvfs_includes])
65 test $ac_cv_member_struct_statvfs_f_fstypename = yes ||
66 { test $ac_cv_member_struct_statfs_f_fstypename != yes &&
67 { AC_CHECK_MEMBERS([struct statvfs.f_type],,, [$statvfs_includes])
68 test $ac_cv_member_struct_statvfs_f_type = yes; }; }; }; }
70 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,, [$statvfs_includes])
75 return (s.s_fsid ^ 0) == 0;])],
76 [AC_DEFINE([STRUCT_STATVFS_F_FSID_IS_INTEGER], [1],
77 [Define to 1 if the f_fsid member of struct statvfs is an integer.])])
79 AC_CHECK_MEMBERS([struct statfs.f_namelen, struct statfs.f_type,
80 struct statfs.f_frsize],,, [$statfs_includes])
81 if test $ac_cv_header_OS_h != yes; then
86 return (s.s_fsid ^ 0) == 0;])],
87 [AC_DEFINE([STRUCT_STATFS_F_FSID_IS_INTEGER], [1],
88 [Define to 1 if the f_fsid member of struct statfs is an integer.])])
95 dnl Filesystem information detection
97 dnl To get information about the disk, mount points, etc.
100 AC_DEFUN([mc_AC_GET_FS_INFO], [
102 if test $gl_cv_list_mounted_fs = yes; then
103 gl_PREREQ_MOUNTLIST_EXTRA
106 AC_CHECK_HEADERS([fcntl.h utime.h])
108 gl_LIST_MOUNTED_FILE_SYSTEMS([
109 AC_DEFINE(HAVE_INFOMOUNT_LIST, 1,
110 [Define if the list of mounted filesystems can be determined])],
111 [AC_MSG_WARN([could not determine how to read list of mounted fs])])
114 if test $gl_cv_fs_space = yes; then
115 gl_PREREQ_FSUSAGE_EXTRA
121 mc_cu_PREREQ_STAT_PROG