bsd-statvfs: include sys/vfs.h, check for f_flags.
This commit is contained in:
parent
e9dede06e5
commit
11057564eb
18
configure.ac
18
configure.ac
|
@ -409,6 +409,7 @@ AC_CHECK_HEADERS([ \
|
||||||
sys/sysmacros.h \
|
sys/sysmacros.h \
|
||||||
sys/time.h \
|
sys/time.h \
|
||||||
sys/timers.h \
|
sys/timers.h \
|
||||||
|
sys/vfs.h \
|
||||||
time.h \
|
time.h \
|
||||||
tmpdir.h \
|
tmpdir.h \
|
||||||
ttyent.h \
|
ttyent.h \
|
||||||
|
@ -3659,6 +3660,23 @@ AC_CHECK_TYPES([fsblkcnt_t, fsfilcnt_t], , , [
|
||||||
#endif
|
#endif
|
||||||
])
|
])
|
||||||
|
|
||||||
|
AC_CHECK_MEMBERS([struct statfs.f_flags], [], [], [[
|
||||||
|
#include <sys/types.h>
|
||||||
|
#ifdef HAVE_SYS_BITYPES_H
|
||||||
|
#include <sys/bitypes.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_STATFS_H
|
||||||
|
#include <sys/statfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_STATVFS_H
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_SYS_VFS_H
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
]])
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_TYPES([in_addr_t, in_port_t], , ,
|
AC_CHECK_TYPES([in_addr_t, in_port_t], , ,
|
||||||
[#include <sys/types.h>
|
[#include <sys/types.h>
|
||||||
#include <netinet/in.h>])
|
#include <netinet/in.h>])
|
||||||
|
|
|
@ -25,6 +25,10 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
|
#ifndef MNAMELEN
|
||||||
|
# define MNAMELEN 32
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
|
copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
|
||||||
{
|
{
|
||||||
|
@ -37,7 +41,11 @@ copy_statfs_to_statvfs(struct statvfs *to, struct statfs *from)
|
||||||
to->f_ffree = from->f_ffree;
|
to->f_ffree = from->f_ffree;
|
||||||
to->f_favail = from->f_ffree; /* no exact equivalent */
|
to->f_favail = from->f_ffree; /* no exact equivalent */
|
||||||
to->f_fsid = 0; /* XXX fix me */
|
to->f_fsid = 0; /* XXX fix me */
|
||||||
|
#ifdef HAVE_STRUCT_STATFS_F_FLAGS
|
||||||
to->f_flag = from->f_flags;
|
to->f_flag = from->f_flags;
|
||||||
|
#else
|
||||||
|
to->f_flag = 0;
|
||||||
|
#endif
|
||||||
to->f_namemax = MNAMELEN;
|
to->f_namemax = MNAMELEN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@
|
||||||
#ifdef HAVE_SYS_STATFS_H
|
#ifdef HAVE_SYS_STATFS_H
|
||||||
#include <sys/statfs.h>
|
#include <sys/statfs.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_VFS_H
|
||||||
|
#include <sys/vfs.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_FSBLKCNT_T
|
#ifndef HAVE_FSBLKCNT_T
|
||||||
typedef unsigned long fsblkcnt_t;
|
typedef unsigned long fsblkcnt_t;
|
||||||
|
|
Loading…
Reference in New Issue