diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 09:22:57 (GMT) |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2009-01-15 10:19:08 (GMT) |
commit | 71cdb52799220f8d9052643baf1d3e9836a9c755 (patch) | |
tree | 27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/m4/fsusage.m4 | |
parent | f7afa46586645e50498d8b2d0c67884f014dc3a4 (diff) | |
download | monitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz |
Sync with gnulib
Diffstat (limited to 'gl/m4/fsusage.m4')
-rw-r--r-- | gl/m4/fsusage.m4 | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4 index 18eedbc..8b8cbf7 100644 --- a/gl/m4/fsusage.m4 +++ b/gl/m4/fsusage.m4 | |||
@@ -1,7 +1,7 @@ | |||
1 | #serial 23 | 1 | # serial 24 |
2 | # Obtaining file system usage information. | 2 | # Obtaining file system usage information. |
3 | 3 | ||
4 | # Copyright (C) 1997, 1998, 2000, 2001, 2003-2007 Free Software Foundation, Inc. | 4 | # Copyright (C) 1997-1998, 2000-2001, 2003-2009 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, |
@@ -11,16 +11,16 @@ | |||
11 | 11 | ||
12 | AC_DEFUN([gl_FSUSAGE], | 12 | AC_DEFUN([gl_FSUSAGE], |
13 | [ | 13 | [ |
14 | AC_CHECK_HEADERS_ONCE(sys/param.h) | 14 | AC_CHECK_HEADERS_ONCE([sys/param.h]) |
15 | AC_CHECK_HEADERS_ONCE(sys/vfs.h sys/fs_types.h) | 15 | AC_CHECK_HEADERS_ONCE([sys/vfs.h sys/fs_types.h]) |
16 | AC_CHECK_HEADERS(sys/mount.h, [], [], | 16 | AC_CHECK_HEADERS([sys/mount.h], [], [], |
17 | [AC_INCLUDES_DEFAULT | 17 | [AC_INCLUDES_DEFAULT |
18 | [#if HAVE_SYS_PARAM_H | 18 | [#if HAVE_SYS_PARAM_H |
19 | #include <sys/param.h> | 19 | #include <sys/param.h> |
20 | #endif]]) | 20 | #endif]]) |
21 | gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) | 21 | gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no]) |
22 | if test $gl_cv_fs_space = yes; then | 22 | if test $gl_cv_fs_space = yes; then |
23 | AC_LIBOBJ(fsusage) | 23 | AC_LIBOBJ([fsusage]) |
24 | gl_PREREQ_FSUSAGE_EXTRA | 24 | gl_PREREQ_FSUSAGE_EXTRA |
25 | fi | 25 | fi |
26 | ]) | 26 | ]) |
@@ -38,21 +38,21 @@ AC_MSG_NOTICE([checking how to get file system space usage]) | |||
38 | ac_fsusage_space=no | 38 | ac_fsusage_space=no |
39 | 39 | ||
40 | # Perform only the link test since it seems there are no variants of the | 40 | # Perform only the link test since it seems there are no variants of the |
41 | # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs) | 41 | # statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs]) |
42 | # because that got a false positive on SCO OSR5. Adding the declaration | 42 | # because that got a false positive on SCO OSR5. Adding the declaration |
43 | # of a `struct statvfs' causes this test to fail (as it should) on such | 43 | # of a `struct statvfs' causes this test to fail (as it should) on such |
44 | # systems. That system is reported to work fine with STAT_STATFS4 which | 44 | # systems. That system is reported to work fine with STAT_STATFS4 which |
45 | # is what it gets when this test fails. | 45 | # is what it gets when this test fails. |
46 | if test $ac_fsusage_space = no; then | 46 | if 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_TRY_LINK([#include <sys/types.h> |
50 | #if defined __GLIBC__ && !defined __BEOS__ | 50 | #if defined __GLIBC__ && defined __linux__ |
51 | Do not use statvfs on systems with GNU libc, because that function stats | 51 | Do not use statvfs on systems with GNU libc on Linux, because that function |
52 | all preceding entries in /proc/mounts, and that makes df hang if even | 52 | stats all preceding entries in /proc/mounts, and that makes df hang if even |
53 | one of the corresponding file systems is hard-mounted, but not available. | 53 | one of the corresponding file systems is hard-mounted, but not available. |
54 | statvfs in GNU libc on BeOS operates differently: it only makes a system | 54 | statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes |
55 | call. | 55 | a system call. |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | #ifdef __osf__ | 58 | #ifdef __osf__ |
@@ -65,7 +65,7 @@ call. | |||
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 |
71 | fi | 71 | fi |
@@ -73,7 +73,7 @@ fi | |||
73 | if test $ac_fsusage_space = no; then | 73 | 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_TRY_RUN([ |
78 | #include <sys/param.h> | 78 | #include <sys/param.h> |
79 | #include <sys/types.h> | 79 | #include <sys/types.h> |
@@ -88,10 +88,10 @@ if test $ac_fsusage_space = no; then | |||
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 |
97 | fi | 97 | fi |
@@ -100,7 +100,7 @@ if test $ac_fsusage_space = no; then | |||
100 | # AIX | 100 | # AIX |
101 | AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl | 101 | AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl |
102 | member (AIX, 4.3BSD)]) | 102 | member (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_TRY_RUN([ |
105 | #ifdef HAVE_SYS_PARAM_H | 105 | #ifdef HAVE_SYS_PARAM_H |
106 | #include <sys/param.h> | 106 | #include <sys/param.h> |
@@ -121,10 +121,10 @@ member (AIX, 4.3BSD)]) | |||
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 |
127 | AC_DEFINE(STAT_STATFS2_BSIZE, 1, | 127 | AC_DEFINE([STAT_STATFS2_BSIZE], [1], |
128 | [ Define if statfs takes 2 args and struct statfs has a field named f_bsize. | 128 | [ Define if statfs takes 2 args and struct statfs has a field named f_bsize. |
129 | (4.3BSD, SunOS 4, HP-UX, AIX PS/2)]) | 129 | (4.3BSD, SunOS 4, HP-UX, AIX PS/2)]) |
130 | fi | 130 | fi |
@@ -133,7 +133,7 @@ fi | |||
133 | if test $ac_fsusage_space = no; then | 133 | 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_TRY_RUN([#include <sys/types.h> |
138 | #include <sys/statfs.h> | 138 | #include <sys/statfs.h> |
139 | int | 139 | int |
@@ -145,10 +145,10 @@ if test $ac_fsusage_space = no; then | |||
145 | fu_cv_sys_stat_statfs4=yes, | 145 | fu_cv_sys_stat_statfs4=yes, |
146 | fu_cv_sys_stat_statfs4=no, | 146 | fu_cv_sys_stat_statfs4=no, |
147 | fu_cv_sys_stat_statfs4=no)]) | 147 | fu_cv_sys_stat_statfs4=no)]) |
148 | AC_MSG_RESULT($fu_cv_sys_stat_statfs4) | 148 | AC_MSG_RESULT([$fu_cv_sys_stat_statfs4]) |
149 | if test $fu_cv_sys_stat_statfs4 = yes; then | 149 | if test $fu_cv_sys_stat_statfs4 = yes; then |
150 | ac_fsusage_space=yes | 150 | ac_fsusage_space=yes |
151 | AC_DEFINE(STAT_STATFS4, 1, | 151 | AC_DEFINE([STAT_STATFS4], [1], |
152 | [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)]) | 152 | [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)]) |
153 | fi | 153 | fi |
154 | fi | 154 | fi |
@@ -157,7 +157,7 @@ if test $ac_fsusage_space = no; then | |||
157 | # 4.4BSD and NetBSD | 157 | # 4.4BSD and NetBSD |
158 | AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl | 158 | AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl |
159 | member (4.4BSD and NetBSD)]) | 159 | member (4.4BSD and NetBSD)]) |
160 | AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize, | 160 | AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize], |
161 | [AC_TRY_RUN([#include <sys/types.h> | 161 | [AC_TRY_RUN([#include <sys/types.h> |
162 | #ifdef HAVE_SYS_PARAM_H | 162 | #ifdef HAVE_SYS_PARAM_H |
163 | #include <sys/param.h> | 163 | #include <sys/param.h> |
@@ -175,10 +175,10 @@ member (4.4BSD and NetBSD)]) | |||
175 | fu_cv_sys_stat_statfs2_fsize=yes, | 175 | fu_cv_sys_stat_statfs2_fsize=yes, |
176 | fu_cv_sys_stat_statfs2_fsize=no, | 176 | fu_cv_sys_stat_statfs2_fsize=no, |
177 | fu_cv_sys_stat_statfs2_fsize=no)]) | 177 | fu_cv_sys_stat_statfs2_fsize=no)]) |
178 | AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize) | 178 | AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_fsize]) |
179 | if test $fu_cv_sys_stat_statfs2_fsize = yes; then | 179 | if test $fu_cv_sys_stat_statfs2_fsize = yes; then |
180 | ac_fsusage_space=yes | 180 | ac_fsusage_space=yes |
181 | AC_DEFINE(STAT_STATFS2_FSIZE, 1, | 181 | AC_DEFINE([STAT_STATFS2_FSIZE], [1], |
182 | [ Define if statfs takes 2 args and struct statfs has a field named f_fsize. | 182 | [ Define if statfs takes 2 args and struct statfs has a field named f_fsize. |
183 | (4.4BSD, NetBSD)]) | 183 | (4.4BSD, NetBSD)]) |
184 | fi | 184 | fi |
@@ -187,7 +187,7 @@ fi | |||
187 | if test $ac_fsusage_space = no; then | 187 | if test $ac_fsusage_space = no; then |
188 | # Ultrix | 188 | # Ultrix |
189 | AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) | 189 | AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)]) |
190 | AC_CACHE_VAL(fu_cv_sys_stat_fs_data, | 190 | AC_CACHE_VAL([fu_cv_sys_stat_fs_data], |
191 | [AC_TRY_RUN([#include <sys/types.h> | 191 | [AC_TRY_RUN([#include <sys/types.h> |
192 | #ifdef HAVE_SYS_PARAM_H | 192 | #ifdef HAVE_SYS_PARAM_H |
193 | #include <sys/param.h> | 193 | #include <sys/param.h> |
@@ -209,10 +209,10 @@ if test $ac_fsusage_space = no; then | |||
209 | fu_cv_sys_stat_fs_data=yes, | 209 | fu_cv_sys_stat_fs_data=yes, |
210 | fu_cv_sys_stat_fs_data=no, | 210 | fu_cv_sys_stat_fs_data=no, |
211 | fu_cv_sys_stat_fs_data=no)]) | 211 | fu_cv_sys_stat_fs_data=no)]) |
212 | AC_MSG_RESULT($fu_cv_sys_stat_fs_data) | 212 | AC_MSG_RESULT([$fu_cv_sys_stat_fs_data]) |
213 | if test $fu_cv_sys_stat_fs_data = yes; then | 213 | if test $fu_cv_sys_stat_fs_data = yes; then |
214 | ac_fsusage_space=yes | 214 | ac_fsusage_space=yes |
215 | AC_DEFINE(STAT_STATFS2_FS_DATA, 1, | 215 | AC_DEFINE([STAT_STATFS2_FS_DATA], [1], |
216 | [ Define if statfs takes 2 args and the second argument has | 216 | [ Define if statfs takes 2 args and the second argument has |
217 | type struct fs_data. (Ultrix)]) | 217 | type struct fs_data. (Ultrix)]) |
218 | fi | 218 | fi |
@@ -222,7 +222,7 @@ if test $ac_fsusage_space = no; then | |||
222 | # SVR2 | 222 | # SVR2 |
223 | AC_TRY_CPP([#include <sys/filsys.h> | 223 | AC_TRY_CPP([#include <sys/filsys.h> |
224 | ], | 224 | ], |
225 | AC_DEFINE(STAT_READ_FILSYS, 1, | 225 | AC_DEFINE([STAT_READ_FILSYS], [1], |
226 | [Define if there is no specific function for reading file systems usage | 226 | [Define if there is no specific function for reading file systems usage |
227 | information and you have the <sys/filsys.h> header file. (SVR2)]) | 227 | information and you have the <sys/filsys.h> header file. (SVR2)]) |
228 | ac_fsusage_space=yes) | 228 | ac_fsusage_space=yes) |
@@ -239,7 +239,7 @@ AS_IF([test $ac_fsusage_space = yes], [$1], [$2]) | |||
239 | AC_DEFUN([gl_STATFS_TRUNCATES], | 239 | AC_DEFUN([gl_STATFS_TRUNCATES], |
240 | [ | 240 | [ |
241 | AC_MSG_CHECKING([for statfs that truncates block counts]) | 241 | AC_MSG_CHECKING([for statfs that truncates block counts]) |
242 | AC_CACHE_VAL(fu_cv_sys_truncating_statfs, | 242 | AC_CACHE_VAL([fu_cv_sys_truncating_statfs], |
243 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | 243 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ |
244 | #if !defined(sun) && !defined(__sun) | 244 | #if !defined(sun) && !defined(__sun) |
245 | choke -- this is a workaround for a Sun-specific problem | 245 | choke -- this is a workaround for a Sun-specific problem |
@@ -251,19 +251,19 @@ choke -- this is a workaround for a Sun-specific problem | |||
251 | [fu_cv_sys_truncating_statfs=yes], | 251 | [fu_cv_sys_truncating_statfs=yes], |
252 | [fu_cv_sys_truncating_statfs=no])]) | 252 | [fu_cv_sys_truncating_statfs=no])]) |
253 | if test $fu_cv_sys_truncating_statfs = yes; then | 253 | if test $fu_cv_sys_truncating_statfs = yes; then |
254 | AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1, | 254 | AC_DEFINE([STATFS_TRUNCATES_BLOCK_COUNTS], [1], |
255 | [Define if the block counts reported by statfs may be truncated to 2GB | 255 | [Define if the block counts reported by statfs may be truncated to 2GB |
256 | and the correct values may be stored in the f_spare array. | 256 | and the correct values may be stored in the f_spare array. |
257 | (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. | 257 | (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem. |
258 | SunOS 4.1.1 seems not to be affected.)]) | 258 | SunOS 4.1.1 seems not to be affected.)]) |
259 | fi | 259 | fi |
260 | AC_MSG_RESULT($fu_cv_sys_truncating_statfs) | 260 | AC_MSG_RESULT([$fu_cv_sys_truncating_statfs]) |
261 | ]) | 261 | ]) |
262 | 262 | ||
263 | 263 | ||
264 | # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. | 264 | # Prerequisites of lib/fsusage.c not done by gl_FILE_SYSTEM_USAGE. |
265 | AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], | 265 | AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA], |
266 | [ | 266 | [ |
267 | AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h) | 267 | AC_CHECK_HEADERS([dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h]) |
268 | gl_STATFS_TRUNCATES | 268 | gl_STATFS_TRUNCATES |
269 | ]) | 269 | ]) |