On Wed, Jan 11, 2017 at 02:25:56PM +0000, James Cowgill wrote:
> The newfstatat testcase on mips64 currently fails because:
> - The BOGUS_STRUCT_STAT test segfaults inside glibc.
> - The result of the fstatat call gives incorrect dates because the
>   kernel struct stat uses unsigned int timestamps.
> 
> Fix by using avoiding the glibc wrapper and using the relevant syscall
> directly. This obviously avoids the first problem, and avoids the second
> problem because print_stat always sign extends dates (unlike glibc which
> will zero extend them).

Unfortunately, this makes fstatat64.test fail on x86
because of struct stat mismatch.

If tests/fstatat.c is changed to define USE_ASM_STAT, then
tests/fstatat64.c would need more stat64 related definitions
(like in tests/fstat64.c), and I cannot tell off-hand whether
fstatat64 takes struct stat64 on all platforms like it's declared
in kernel's include/linux/syscalls.h file.

btw, tests/fstatat.c is the last user of tests/xstatx.c that
does not define USE_ASM_STAT yet.

> ---
>  tests/fstatat.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/fstatat.c b/tests/fstatat.c
> index ec55ca04..3981b4ec 100644
> --- a/tests/fstatat.c
> +++ b/tests/fstatat.c
> @@ -28,7 +28,7 @@
>  #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; \
> @@ -38,6 +38,8 @@
>               printf(", AT_SYMLINK_NOFOLLOW) = %s\n", sprintrc(rc)); \
>       } while (0)
>  
> +# define USE_ASM_STAT
> +
>  # include "xstatx.c"
>  
>  #else


-- 
ldv

Attachment: pgpm8Y3eayHLu.pgp
Description: PGP signature

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to