summaryrefslogtreecommitdiffstats
path: root/gl/m4/fsusage.m4
diff options
context:
space:
mode:
Diffstat (limited to 'gl/m4/fsusage.m4')
-rw-r--r--gl/m4/fsusage.m447
1 files changed, 8 insertions, 39 deletions
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4
index 1ce90660..db6e0e3b 100644
--- a/gl/m4/fsusage.m4
+++ b/gl/m4/fsusage.m4
@@ -1,9 +1,11 @@
1# fsusage.m4 1# fsusage.m4
2# serial 35 2# serial 37
3dnl Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software Foundation, Inc. 3dnl Copyright (C) 1997-1998, 2000-2001, 2003-2026 Free Software Foundation,
4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 7dnl with or without modifications, as long as this notice is preserved.
8dnl This file is offered as-is, without any warranty.
7 9
8# Obtaining file system usage information. 10# Obtaining file system usage information.
9 11
@@ -46,16 +48,12 @@ AC_DEFUN([gl_FILE_SYSTEM_USAGE],
46 # is what it gets when this test fails. 48 # is what it gets when this test fails.
47 if test $ac_fsusage_space = no; then 49 if test $ac_fsusage_space = no; then
48 # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, 50 # glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
49 # OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS. 51 # OpenBSD >= 4.4, AIX, HP-UX, Solaris, Cygwin, Interix, BeOS.
50 AC_CACHE_CHECK([for statvfs function (SVR4)], 52 AC_CACHE_CHECK([for statvfs function (SVR4)],
51 [fu_cv_sys_stat_statvfs], 53 [fu_cv_sys_stat_statvfs],
52 [AC_LINK_IFELSE( 54 [AC_LINK_IFELSE(
53 [AC_LANG_PROGRAM([[ 55 [AC_LANG_PROGRAM([[
54#include <sys/types.h> 56#include <sys/types.h>
55#ifdef __osf__
56"Do not use Tru64's statvfs implementation"
57#endif
58
59#include <sys/statvfs.h> 57#include <sys/statvfs.h>
60 58
61struct statvfs fsd; 59struct statvfs fsd;
@@ -77,7 +75,7 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
77 if test $fu_cv_sys_stat_statvfs = yes; then 75 if test $fu_cv_sys_stat_statvfs = yes; then
78 ac_fsusage_space=yes 76 ac_fsusage_space=yes
79 # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs. 77 # AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
80 # glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems 78 # glibc, HP-UX, Solaris have statvfs64 as well, but on these systems
81 # statvfs with large-file support is already equivalent to statvfs64. 79 # statvfs with large-file support is already equivalent to statvfs64.
82 AC_CACHE_CHECK([whether to use statvfs64], 80 AC_CACHE_CHECK([whether to use statvfs64],
83 [fu_cv_sys_stat_statvfs64], 81 [fu_cv_sys_stat_statvfs64],
@@ -139,37 +137,9 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
139 fi 137 fi
140 138
141 if test $ac_fsusage_space = no; then 139 if test $ac_fsusage_space = no; then
142 # DEC Alpha running OSF/1
143 AC_CACHE_CHECK([for 3-argument statfs function (DEC OSF/1)],
144 [fu_cv_sys_stat_statfs3_osf1],
145 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
146#include <sys/param.h>
147#include <sys/types.h>
148#include <sys/mount.h>
149 int
150 main ()
151 {
152 struct statfs fsd;
153 fsd.f_fsize = 0;
154 return statfs (".", &fsd, sizeof (struct statfs)) != 0;
155 }]])],
156 [fu_cv_sys_stat_statfs3_osf1=yes],
157 [fu_cv_sys_stat_statfs3_osf1=no],
158 [fu_cv_sys_stat_statfs3_osf1=no])
159 ])
160 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
161 ac_fsusage_space=yes
162 AC_DEFINE([STAT_STATFS3_OSF1], [1],
163 [Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
164 fi
165 fi
166
167 if test $ac_fsusage_space = no; then
168 # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4. 140 # glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
169 # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0, 141 # (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
170 # OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.) 142 # OpenBSD >= 4.4, AIX, HP-UX, Cygwin already handled above.)
171 # (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
172 # <sys/vfs.h>.)
173 # (On Solaris, statfs has 4 arguments.) 143 # (On Solaris, statfs has 4 arguments.)
174 AC_CACHE_CHECK([for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)], 144 AC_CACHE_CHECK([for two-argument statfs with statfs.f_bsize member (AIX, 4.3BSD)],
175 [fu_cv_sys_stat_statfs2_bsize], 145 [fu_cv_sys_stat_statfs2_bsize],
@@ -223,13 +193,12 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
223 if test $fu_cv_sys_stat_statfs4 = yes; then 193 if test $fu_cv_sys_stat_statfs4 = yes; then
224 ac_fsusage_space=yes 194 ac_fsusage_space=yes
225 AC_DEFINE([STAT_STATFS4], [1], 195 AC_DEFINE([STAT_STATFS4], [1],
226 [Define if statfs takes 4 args. (SVR3, old Irix)]) 196 [Define if statfs takes 4 args. (SVR3)])
227 fi 197 fi
228 fi 198 fi
229 199
230 if test $ac_fsusage_space = no; then 200 if test $ac_fsusage_space = no; then
231 # 4.4BSD and older NetBSD 201 # 4.4BSD and older NetBSD
232 # (OSF/1 already handled above.)
233 # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.) 202 # (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
234 # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in 203 # (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
235 # <sys/mount.h>.) 204 # <sys/mount.h>.)