Imported Upstream version 1.4.16+git20130902
This commit is contained in:
parent
e76be63abf
commit
e70fb8c051
517 changed files with 44015 additions and 43295 deletions
127
gl/m4/fsusage.m4
127
gl/m4/fsusage.m4
|
@ -1,7 +1,7 @@
|
|||
# serial 25
|
||||
# serial 30
|
||||
# Obtaining file system usage information.
|
||||
|
||||
# Copyright (C) 1997-1998, 2000-2001, 2003-2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1997-1998, 2000-2001, 2003-2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
|
@ -19,10 +19,6 @@ AC_DEFUN([gl_FSUSAGE],
|
|||
#include <sys/param.h>
|
||||
#endif]])
|
||||
gl_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
|
||||
if test $gl_cv_fs_space = yes; then
|
||||
AC_LIBOBJ([fsusage])
|
||||
gl_PREREQ_FSUSAGE_EXTRA
|
||||
fi
|
||||
])
|
||||
|
||||
# Try to determine how a program can obtain file system usage information.
|
||||
|
@ -33,6 +29,12 @@ AC_DEFUN([gl_FSUSAGE],
|
|||
|
||||
AC_DEFUN([gl_FILE_SYSTEM_USAGE],
|
||||
[
|
||||
dnl Enable large-file support. This has the effect of changing the size
|
||||
dnl of field f_blocks in 'struct statvfs' from 32 bit to 64 bit on
|
||||
dnl glibc/Hurd, HP-UX 11, Solaris (32-bit mode). It also changes the size
|
||||
dnl of field f_blocks in 'struct statfs' from 32 bit to 64 bit on
|
||||
dnl Mac OS X >= 10.5 (32-bit mode).
|
||||
AC_REQUIRE([AC_SYS_LARGEFILE])
|
||||
|
||||
AC_MSG_NOTICE([checking how to get file system space usage])
|
||||
ac_fsusage_space=no
|
||||
|
@ -40,36 +42,98 @@ ac_fsusage_space=no
|
|||
# Perform only the link test since it seems there are no variants of the
|
||||
# statvfs function. This check is more than just AC_CHECK_FUNCS([statvfs])
|
||||
# because that got a false positive on SCO OSR5. Adding the declaration
|
||||
# of a `struct statvfs' causes this test to fail (as it should) on such
|
||||
# of a 'struct statvfs' causes this test to fail (as it should) on such
|
||||
# systems. That system is reported to work fine with STAT_STATFS4 which
|
||||
# is what it gets when this test fails.
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR4
|
||||
# glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
|
||||
# OpenBSD >= 4.4, AIX, HP-UX, IRIX, Solaris, Cygwin, Interix, BeOS.
|
||||
AC_CACHE_CHECK([for statvfs function (SVR4)], [fu_cv_sys_stat_statvfs],
|
||||
[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#if defined __GLIBC__ && defined __linux__
|
||||
Do not use statvfs on systems with GNU libc on Linux, because that function
|
||||
stats all preceding entries in /proc/mounts, and that makes df hang if even
|
||||
one of the corresponding file systems is hard-mounted, but not available.
|
||||
statvfs in GNU libc on Hurd, BeOS, Haiku operates differently: it only makes
|
||||
a system call.
|
||||
#endif
|
||||
|
||||
#ifdef __osf__
|
||||
"Do not use Tru64's statvfs implementation"
|
||||
#endif
|
||||
|
||||
#include <sys/statvfs.h>]],
|
||||
[[struct statvfs fsd; statvfs (0, &fsd);]])],
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
struct statvfs fsd;
|
||||
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
#include <limits.h>
|
||||
/* On Mac OS X >= 10.5, f_blocks in 'struct statvfs' is a 32-bit quantity;
|
||||
that commonly limits file systems to 4 TiB. Whereas f_blocks in
|
||||
'struct statfs' is a 64-bit type, thanks to the large-file support
|
||||
that was enabled above. In this case, don't use statvfs(); use statfs()
|
||||
instead. */
|
||||
int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
|
||||
#endif
|
||||
]],
|
||||
[[statvfs (0, &fsd);]])],
|
||||
[fu_cv_sys_stat_statvfs=yes],
|
||||
[fu_cv_sys_stat_statvfs=no])])
|
||||
if test $fu_cv_sys_stat_statvfs = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATVFS], [1],
|
||||
[ Define if there is a function named statvfs. (SVR4)])
|
||||
# AIX >= 5.2 has statvfs64 that has a wider f_blocks field than statvfs.
|
||||
# glibc, HP-UX, IRIX, Solaris have statvfs64 as well, but on these systems
|
||||
# statvfs with large-file support is already equivalent to statvfs64.
|
||||
AC_CACHE_CHECK([whether to use statvfs64],
|
||||
[fu_cv_sys_stat_statvfs64],
|
||||
[AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[#include <sys/types.h>
|
||||
#include <sys/statvfs.h>
|
||||
struct statvfs64 fsd;
|
||||
int check_f_blocks_larger_in_statvfs64
|
||||
[sizeof (((struct statvfs64 *) 0)->f_blocks)
|
||||
> sizeof (((struct statvfs *) 0)->f_blocks)
|
||||
? 1 : -1];
|
||||
]],
|
||||
[[statvfs64 (0, &fsd);]])],
|
||||
[fu_cv_sys_stat_statvfs64=yes],
|
||||
[fu_cv_sys_stat_statvfs64=no])
|
||||
])
|
||||
if test $fu_cv_sys_stat_statvfs64 = yes; then
|
||||
AC_DEFINE([STAT_STATVFS64], [1],
|
||||
[ Define if statvfs64 should be preferred over statvfs.])
|
||||
else
|
||||
AC_DEFINE([STAT_STATVFS], [1],
|
||||
[ Define if there is a function named statvfs. (SVR4)])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check for this unconditionally so we have a
|
||||
# good fallback on glibc/Linux > 2.6 < 2.6.36
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_frsize member])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_frsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#ifdef HAVE_SYS_PARAM_H
|
||||
#include <sys/param.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_MOUNT_H
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_VFS_H
|
||||
#include <sys/vfs.h>
|
||||
#endif
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct statfs fsd;
|
||||
fsd.f_frsize = 0;
|
||||
return statfs (".", &fsd) != 0;
|
||||
}]])],
|
||||
[fu_cv_sys_stat_statfs2_frsize=yes],
|
||||
[fu_cv_sys_stat_statfs2_frsize=no],
|
||||
[fu_cv_sys_stat_statfs2_frsize=no])])
|
||||
AC_MSG_RESULT([$fu_cv_sys_stat_statfs2_frsize])
|
||||
if test $fu_cv_sys_stat_statfs2_frsize = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATFS2_FRSIZE], [1],
|
||||
[ Define if statfs takes 2 args and struct statfs has a field named f_frsize.
|
||||
(glibc/Linux > 2.6)])
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# DEC Alpha running OSF/1
|
||||
AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
|
||||
|
@ -97,8 +161,13 @@ if test $ac_fsusage_space = no; then
|
|||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# AIX
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
|
||||
# glibc/Linux, Mac OS X, FreeBSD < 5.0, NetBSD < 3.0, OpenBSD < 4.4.
|
||||
# (glibc/{Hurd,kFreeBSD}, FreeBSD >= 5.0, NetBSD >= 3.0,
|
||||
# OpenBSD >= 4.4, AIX, HP-UX, OSF/1, Cygwin already handled above.)
|
||||
# (On IRIX you need to include <sys/statfs.h>, not only <sys/mount.h> and
|
||||
# <sys/vfs.h>.)
|
||||
# (On Solaris, statfs has 4 arguments.)
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_bsize dnl
|
||||
member (AIX, 4.3BSD)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_bsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -131,7 +200,8 @@ member (AIX, 4.3BSD)])
|
|||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR3
|
||||
# SVR3
|
||||
# (Solaris already handled above.)
|
||||
AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs4],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -150,13 +220,17 @@ if test $ac_fsusage_space = no; then
|
|||
if test $fu_cv_sys_stat_statfs4 = yes; then
|
||||
ac_fsusage_space=yes
|
||||
AC_DEFINE([STAT_STATFS4], [1],
|
||||
[ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
|
||||
[ Define if statfs takes 4 args. (SVR3, Dynix, old Irix, old AIX, Dolphin)])
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# 4.4BSD and NetBSD
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
|
||||
# 4.4BSD and older NetBSD
|
||||
# (OSF/1 already handled above.)
|
||||
# (On AIX, you need to include <sys/statfs.h>, not only <sys/mount.h>.)
|
||||
# (On Solaris, statfs has 4 arguments and 'struct statfs' is not declared in
|
||||
# <sys/mount.h>.)
|
||||
AC_MSG_CHECKING([for two-argument statfs with statfs.f_fsize dnl
|
||||
member (4.4BSD and NetBSD)])
|
||||
AC_CACHE_VAL([fu_cv_sys_stat_statfs2_fsize],
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
|
@ -223,6 +297,7 @@ fi
|
|||
|
||||
if test $ac_fsusage_space = no; then
|
||||
# SVR2
|
||||
# (AIX, HP-UX, OSF/1 already handled above.)
|
||||
AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <sys/filsys.h>
|
||||
]])],
|
||||
[AC_DEFINE([STAT_READ_FILSYS], [1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue