Do not use glibc wrappers to call newfstatat and fstatat64.
These wrappers have various problems, e.g. they segfault on sparc64
and mips64 if BOGUS_STRUCT_STAT is not disabled, and they do wrong
conversion of timestamps on mips64.
* tests/fstatat.c (TEST_SYSCALL_INVOKE): Invoke the relevant syscall
directly.
(USE_ASM_STAT): Define.
* tests/fstatat64.c (TEST_BOGUS_STRUCT_STAT): Remove.
(STRUCT_STAT, STRUCT_STAT_STR, STRUCT_STAT_IS_STAT64): Define.
Based on patch by James Cowgill <james410@cowgill.org.uk>.
#ifdef HAVE_FSTATAT
# define TEST_SYSCALL_INVOKE(sample, pst) \
- fstatat(AT_FDCWD, sample, pst, AT_SYMLINK_NOFOLLOW)
+ syscall(TEST_SYSCALL_NR, AT_FDCWD, sample, pst, AT_SYMLINK_NOFOLLOW)
# define PRINT_SYSCALL_HEADER(sample) \
do { \
int saved_errno = errno; \
printf(", AT_SYMLINK_NOFOLLOW) = %s\n", sprintrc(rc)); \
} while (0)
+# define USE_ASM_STAT
+
# include "xstatx.c"
#else
# define TEST_SYSCALL_NR __NR_fstatat64
# define TEST_SYSCALL_STR "fstatat64"
-# if defined __GLIBC__ && defined __sparc__ && defined __arch64__
-# define TEST_BOGUS_STRUCT_STAT 0
-# endif
+# define STRUCT_STAT struct stat64
+# define STRUCT_STAT_STR "struct stat64"
+# define STRUCT_STAT_IS_STAT64 1
# include "fstatat.c"
#else