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.m485
1 files changed, 44 insertions, 41 deletions
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4
index 8b8cbf7..216b9dd 100644
--- a/gl/m4/fsusage.m4
+++ b/gl/m4/fsusage.m4
@@ -1,7 +1,7 @@
1# serial 24 1# serial 25
2# Obtaining file system usage information. 2# Obtaining file system usage information.
3 3
4# Copyright (C) 1997-1998, 2000-2001, 2003-2009 Free Software Foundation, Inc. 4# Copyright (C) 1997-1998, 2000-2001, 2003-2010 Free Software Foundation, Inc.
5# 5#
6# This file is free software; the Free Software Foundation 6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it, 7# gives unlimited permission to copy and/or distribute it,
@@ -46,7 +46,7 @@ ac_fsusage_space=no
46if test $ac_fsusage_space = no; then 46if test $ac_fsusage_space = no; then
47 # SVR4 47 # SVR4
48 AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs], 48 AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
49 [AC_TRY_LINK([#include <sys/types.h> 49 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
50#if defined __GLIBC__ && defined __linux__ 50#if defined __GLIBC__ && defined __linux__
51Do not use statvfs on systems with GNU libc on Linux, because that function 51Do not use statvfs on systems with GNU libc on Linux, because that function
52stats all preceding entries in /proc/mounts, and that makes df hang if even 52stats all preceding entries in /proc/mounts, and that makes df hang if even
@@ -59,14 +59,14 @@ a system call.
59"Do not use Tru64's statvfs implementation" 59"Do not use Tru64's statvfs implementation"
60#endif 60#endif
61 61
62#include <sys/statvfs.h>], 62#include <sys/statvfs.h>]],
63 [struct statvfs fsd; statvfs (0, &fsd);], 63 [[struct statvfs fsd; statvfs (0, &fsd);]])],
64 fu_cv_sys_stat_statvfs=yes, 64 [fu_cv_sys_stat_statvfs=yes],
65 fu_cv_sys_stat_statvfs=no)]) 65 [fu_cv_sys_stat_statvfs=no])])
66 if test $fu_cv_sys_stat_statvfs = yes; then 66 if test $fu_cv_sys_stat_statvfs = yes; then
67 ac_fsusage_space=yes 67 ac_fsusage_space=yes
68 AC_DEFINE([STAT_STATVFS], [1], 68 AC_DEFINE([STAT_STATVFS], [1],
69 [ Define if there is a function named statvfs. (SVR4)]) 69 [ Define if there is a function named statvfs. (SVR4)])
70 fi 70 fi
71fi 71fi
72 72
@@ -74,7 +74,7 @@ if test $ac_fsusage_space = no; then
74 # DEC Alpha running OSF/1 74 # DEC Alpha running OSF/1
75 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)]) 75 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
76 AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1], 76 AC_CACHE_VAL([fu_cv_sys_stat_statfs3_osf1],
77 [AC_TRY_RUN([ 77 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
78#include <sys/param.h> 78#include <sys/param.h>
79#include <sys/types.h> 79#include <sys/types.h>
80#include <sys/mount.h> 80#include <sys/mount.h>
@@ -84,15 +84,15 @@ if test $ac_fsusage_space = no; then
84 struct statfs fsd; 84 struct statfs fsd;
85 fsd.f_fsize = 0; 85 fsd.f_fsize = 0;
86 return statfs (".", &fsd, sizeof (struct statfs)) != 0; 86 return statfs (".", &fsd, sizeof (struct statfs)) != 0;
87 }], 87 }]])],
88 fu_cv_sys_stat_statfs3_osf1=yes, 88 [fu_cv_sys_stat_statfs3_osf1=yes],
89 fu_cv_sys_stat_statfs3_osf1=no, 89 [fu_cv_sys_stat_statfs3_osf1=no],
90 fu_cv_sys_stat_statfs3_osf1=no)]) 90 [fu_cv_sys_stat_statfs3_osf1=no])])
91 AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1]) 91 AC_MSG_RESULT([$fu_cv_sys_stat_statfs3_osf1])
92 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then 92 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
93 ac_fsusage_space=yes 93 ac_fsusage_space=yes
94 AC_DEFINE([STAT_STATFS3_OSF1], [1], 94 AC_DEFINE([STAT_STATFS3_OSF1], [1],
95 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)]) 95 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
96 fi 96 fi
97fi 97fi
98 98
@@ -101,7 +101,7 @@ if test $ac_fsusage_space = no; then
101 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl 101 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
102member (AIX, 4.3BSD)]) 102member (AIX, 4.3BSD)])
103 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize], 103 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize],
104 [AC_TRY_RUN([ 104 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
105#ifdef HAVE_SYS_PARAM_H 105#ifdef HAVE_SYS_PARAM_H
106#include <sys/param.h> 106#include <sys/param.h>
107#endif 107#endif
@@ -117,10 +117,10 @@ member (AIX, 4.3BSD)])
117 struct statfs fsd; 117 struct statfs fsd;
118 fsd.f_bsize = 0; 118 fsd.f_bsize = 0;
119 return statfs (".", &fsd) != 0; 119 return statfs (".", &fsd) != 0;
120 }], 120 }]])],
121 fu_cv_sys_stat_statfs2_bsize=yes, 121 [fu_cv_sys_stat_statfs2_bsize=yes],
122 fu_cv_sys_stat_statfs2_bsize=no, 122 [fu_cv_sys_stat_statfs2_bsize=no],
123 fu_cv_sys_stat_statfs2_bsize=no)]) 123 [fu_cv_sys_stat_statfs2_bsize=no])])
124 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize]) 124 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_bsize])
125 if test $fu_cv_sys_stat_statfs2_bsize = yes; then 125 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
126 ac_fsusage_space=yes 126 ac_fsusage_space=yes
@@ -134,22 +134,23 @@ if test $ac_fsusage_space = no; then
134# SVR3 134# SVR3
135 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)]) 135 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
136 AC_CACHE_VAL([fu_cv_sys_stat_statfs4], 136 AC_CACHE_VAL([fu_cv_sys_stat_statfs4],
137 [AC_TRY_RUN([#include <sys/types.h> 137 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
138#include <sys/types.h>
138#include <sys/statfs.h> 139#include <sys/statfs.h>
139 int 140 int
140 main () 141 main ()
141 { 142 {
142 struct statfs fsd; 143 struct statfs fsd;
143 return statfs (".", &fsd, sizeof fsd, 0) != 0; 144 return statfs (".", &fsd, sizeof fsd, 0) != 0;
144 }], 145 }]])],
145 fu_cv_sys_stat_statfs4=yes, 146 [fu_cv_sys_stat_statfs4=yes],
146 fu_cv_sys_stat_statfs4=no, 147 [fu_cv_sys_stat_statfs4=no],
147 fu_cv_sys_stat_statfs4=no)]) 148 [fu_cv_sys_stat_statfs4=no])])
148 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4]) 149 AC_MSG_RESULT([$fu_cv_sys_stat_statfs4])
149 if test $fu_cv_sys_stat_statfs4 = yes; then 150 if test $fu_cv_sys_stat_statfs4 = yes; then
150 ac_fsusage_space=yes 151 ac_fsusage_space=yes
151 AC_DEFINE([STAT_STATFS4], [1], 152 AC_DEFINE([STAT_STATFS4], [1],
152 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)]) 153 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
153 fi 154 fi
154fi 155fi
155 156
@@ -158,7 +159,8 @@ if test $ac_fsusage_space = no; then
158 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl 159 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
159member (4.4BSD and NetBSD)]) 160member (4.4BSD and NetBSD)])
160 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize], 161 AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize],
161 [AC_TRY_RUN([#include <sys/types.h> 162 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
163#include <sys/types.h>
162#ifdef HAVE_SYS_PARAM_H 164#ifdef HAVE_SYS_PARAM_H
163#include <sys/param.h> 165#include <sys/param.h>
164#endif 166#endif
@@ -171,10 +173,10 @@ member (4.4BSD and NetBSD)])
171 struct statfs fsd; 173 struct statfs fsd;
172 fsd.f_fsize = 0; 174 fsd.f_fsize = 0;
173 return statfs (".", &fsd) != 0; 175 return statfs (".", &fsd) != 0;
174 }], 176 }]])],
175 fu_cv_sys_stat_statfs2_fsize=yes, 177 [fu_cv_sys_stat_statfs2_fsize=yes],
176 fu_cv_sys_stat_statfs2_fsize=no, 178 [fu_cv_sys_stat_statfs2_fsize=no],
177 fu_cv_sys_stat_statfs2_fsize=no)]) 179 [fu_cv_sys_stat_statfs2_fsize=no])])
178 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize]) 180 AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize])
179 if test $fu_cv_sys_stat_statfs2_fsize = yes; then 181 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
180 ac_fsusage_space=yes 182 ac_fsusage_space=yes
@@ -188,7 +190,8 @@ if test $ac_fsusage_space = no; then
188 # Ultrix 190 # Ultrix
189 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) 191 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
190 AC_CACHE_VAL([fu_cv_sys_stat_fs_data], 192 AC_CACHE_VAL([fu_cv_sys_stat_fs_data],
191 [AC_TRY_RUN([#include <sys/types.h> 193 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
194#include <sys/types.h>
192#ifdef HAVE_SYS_PARAM_H 195#ifdef HAVE_SYS_PARAM_H
193#include <sys/param.h> 196#include <sys/param.h>
194#endif 197#endif
@@ -205,10 +208,10 @@ if test $ac_fsusage_space = no; then
205 /* Ultrix's statfs returns 1 for success, 208 /* Ultrix's statfs returns 1 for success,
206 0 for not mounted, -1 for failure. */ 209 0 for not mounted, -1 for failure. */
207 return statfs (".", &fsd) != 1; 210 return statfs (".", &fsd) != 1;
208 }], 211 }]])],
209 fu_cv_sys_stat_fs_data=yes, 212 [fu_cv_sys_stat_fs_data=yes],
210 fu_cv_sys_stat_fs_data=no, 213 [fu_cv_sys_stat_fs_data=no],
211 fu_cv_sys_stat_fs_data=no)]) 214 [fu_cv_sys_stat_fs_data=no])])
212 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data]) 215 AC_MSG_RESULT([$fu_cv_sys_stat_fs_data])
213 if test $fu_cv_sys_stat_fs_data = yes; then 216 if test $fu_cv_sys_stat_fs_data = yes; then
214 ac_fsusage_space=yes 217 ac_fsusage_space=yes
@@ -220,12 +223,12 @@ fi
220 223
221if test $ac_fsusage_space = no; then 224if test $ac_fsusage_space = no; then
222 # SVR2 225 # SVR2
223 AC_TRY_CPP([#include <sys/filsys.h> 226 AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/filsys.h>
224 ], 227 ]])],
225 AC_DEFINE([STAT_READ_FILSYS], [1], 228 [AC_DEFINE([STAT_READ_FILSYS], [1],
226 [Define if there is no specific function for reading file systems usage 229 [Define if there is no specific function for reading file systems usage
227 information and you have the <sys/filsys.h> header file. (SVR2)]) 230 information and you have the <sys/filsys.h> header file. (SVR2)])
228 ac_fsusage_space=yes) 231 ac_fsusage_space=yes])
229fi 232fi
230 233
231AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) 234AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
@@ -246,8 +249,8 @@ choke -- this is a workaround for a Sun-specific problem
246#endif 249#endif
247#include <sys/types.h> 250#include <sys/types.h>
248#include <sys/vfs.h>]], 251#include <sys/vfs.h>]],
249 [[struct statfs t; long c = *(t.f_spare); 252 [[struct statfs t; long c = *(t.f_spare);
250 if (c) return 0;]])], 253 if (c) return 0;]])],
251 [fu_cv_sys_truncating_statfs=yes], 254 [fu_cv_sys_truncating_statfs=yes],
252 [fu_cv_sys_truncating_statfs=no])]) 255 [fu_cv_sys_truncating_statfs=no])])
253 if test $fu_cv_sys_truncating_statfs = yes; then 256 if test $fu_cv_sys_truncating_statfs = yes; then