2000-07-02 12:58:27 +00:00
|
|
|
#serial 6
|
1997-09-02 01:46:30 +00:00
|
|
|
|
|
|
|
|
dnl From Jim Meyering.
|
1998-11-14 13:23:22 +00:00
|
|
|
dnl Determine whether stat has the bug that it succeeds when given the
|
1998-11-08 03:42:20 +00:00
|
|
|
dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
|
1998-11-14 13:23:22 +00:00
|
|
|
dnl (as of 1998-11-01) do this.
|
1997-09-02 01:46:30 +00:00
|
|
|
dnl
|
1998-11-08 03:42:20 +00:00
|
|
|
dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
|
|
|
|
|
dnl compile the wrapper function.
|
1997-09-02 01:46:30 +00:00
|
|
|
dnl
|
|
|
|
|
|
|
|
|
|
AC_DEFUN(jm_FUNC_STAT,
|
|
|
|
|
[
|
2000-05-28 21:27:04 +00:00
|
|
|
AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
|
1998-11-08 03:42:20 +00:00
|
|
|
AC_CACHE_CHECK([whether stat accepts an empty string],
|
|
|
|
|
jm_cv_func_stat_empty_string_bug,
|
1997-09-02 01:46:30 +00:00
|
|
|
[AC_TRY_RUN([
|
|
|
|
|
# include <sys/types.h>
|
|
|
|
|
# include <sys/stat.h>
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
main ()
|
|
|
|
|
{
|
|
|
|
|
struct stat sbuf;
|
1998-11-08 03:42:20 +00:00
|
|
|
exit (stat ("", &sbuf) ? 1 : 0);
|
1997-09-02 01:46:30 +00:00
|
|
|
}
|
|
|
|
|
],
|
1998-11-08 03:42:20 +00:00
|
|
|
jm_cv_func_stat_empty_string_bug=yes,
|
|
|
|
|
jm_cv_func_stat_empty_string_bug=no,
|
1997-09-02 01:46:30 +00:00
|
|
|
dnl When crosscompiling, assume stat is broken.
|
1998-11-08 03:42:20 +00:00
|
|
|
jm_cv_func_stat_empty_string_bug=yes)
|
1997-09-02 01:46:30 +00:00
|
|
|
])
|
1998-11-08 03:42:20 +00:00
|
|
|
if test $jm_cv_func_stat_empty_string_bug = yes; then
|
2000-07-02 15:14:04 +00:00
|
|
|
AC_LIBOBJ(stat)
|
1999-01-10 22:50:14 +00:00
|
|
|
AC_DEFINE_UNQUOTED(HAVE_STAT_EMPTY_STRING_BUG, 1,
|
|
|
|
|
[Define if stat has the bug that it succeeds when given the zero-length
|
|
|
|
|
file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
|
|
|
|
|
do this. ])
|
1997-09-02 01:46:30 +00:00
|
|
|
fi
|
|
|
|
|
])
|