Added check for f_namelen in struct statfs.

This commit is contained in:
Alexandre Julliard 2004-03-07 03:16:43 +00:00
parent 5b8d5131a3
commit b859a68682
4 changed files with 143 additions and 1 deletions

137
configure vendored
View File

@ -18900,6 +18900,143 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
fi
echo "$as_me:$LINENO: checking for struct statfs.f_namelen" >&5
echo $ECHO_N "checking for struct statfs.f_namelen... $ECHO_C" >&6
if test "${ac_cv_member_struct_statfs_f_namelen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif
int
main ()
{
static struct statfs ac_aggr;
if (ac_aggr.f_namelen)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_statfs_f_namelen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#ifdef STATFS_DEFINED_BY_SYS_MOUNT
# include <sys/mount.h>
#else
# ifdef STATFS_DEFINED_BY_SYS_VFS
# include <sys/vfs.h>
# else
# ifdef STATFS_DEFINED_BY_SYS_STATFS
# include <sys/statfs.h>
# endif
# endif
#endif
int
main ()
{
static struct statfs ac_aggr;
if (sizeof ac_aggr.f_namelen)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_statfs_f_namelen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_statfs_f_namelen=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_statfs_f_namelen" >&5
echo "${ECHO_T}$ac_cv_member_struct_statfs_f_namelen" >&6
if test $ac_cv_member_struct_statfs_f_namelen = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_STRUCT_STATFS_F_NAMELEN 1
_ACEOF
fi

View File

@ -1386,7 +1386,7 @@ fi
dnl **** FIXME: what about mixed cases, where we need two of them? ***
dnl Check for statfs members
AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_frsize, struct statfs.f_ffree, struct statfs.f_favail],,,
AC_CHECK_MEMBERS([struct statfs.f_bfree, struct statfs.f_bavail, struct statfs.f_frsize, struct statfs.f_ffree, struct statfs.f_favail, struct statfs.f_namelen],,,
[#include <sys/types.h>
#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>

View File

@ -572,6 +572,9 @@
/* Define to 1 if `f_frsize' is member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_FRSIZE
/* Define to 1 if `f_namelen' is member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_NAMELEN
/* Define to 1 if `f_blocks' is member of `struct statvfs'. */
#undef HAVE_STRUCT_STATVFS_F_BLOCKS

View File

@ -57,7 +57,9 @@ int statvfs( const char *path, struct statvfs *buf )
buf->f_bsize = info.f_bsize;
buf->f_blocks = info.f_blocks;
buf->f_files = info.f_files;
#ifdef HAVE_STRUCT_STATFS_F_NAMELEN
buf->f_namemax = info.f_namelen;
#endif
#ifdef HAVE_STRUCT_STATFS_F_FRSIZE
buf->f_frsize = info.f_frsize;
#else