From b859a6868269355b0469841e7fbf678db5167032 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 7 Mar 2004 03:16:43 +0000 Subject: [PATCH] Added check for f_namelen in struct statfs. --- configure | 137 ++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 +- include/config.h.in | 3 + libs/port/statvfs.c | 2 + 4 files changed, 143 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 73b55be8ea8..6fbd31a0cf9 100755 --- a/configure +++ b/configure @@ -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 +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#ifdef STATFS_DEFINED_BY_SYS_MOUNT +# include +#else +# ifdef STATFS_DEFINED_BY_SYS_VFS +# include +# else +# ifdef STATFS_DEFINED_BY_SYS_STATFS +# include +# 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 +#ifdef HAVE_SYS_PARAM_H +# include +#endif +#ifdef STATFS_DEFINED_BY_SYS_MOUNT +# include +#else +# ifdef STATFS_DEFINED_BY_SYS_VFS +# include +# else +# ifdef STATFS_DEFINED_BY_SYS_STATFS +# include +# 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 diff --git a/configure.ac b/configure.ac index 94ce8b3af32..935ae158d30 100644 --- a/configure.ac +++ b/configure.ac @@ -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 #ifdef HAVE_SYS_PARAM_H # include diff --git a/include/config.h.in b/include/config.h.in index 37633ed0fe3..81d213dbdbb 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -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 diff --git a/libs/port/statvfs.c b/libs/port/statvfs.c index fc1f10bd894..d63c5ab31fa 100644 --- a/libs/port/statvfs.c +++ b/libs/port/statvfs.c @@ -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