]> sourceware.org Git - glibc.git/commit
linux: Use INTERNAL_SYSCALL on fstatat{64}
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 14 Oct 2020 17:31:38 +0000 (14:31 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 16 Oct 2020 17:17:44 +0000 (14:17 -0300)
commitcb49c65bb5581b5ca6122898716aad1f075982d8
treecb7a33adffca63e59802ba2a8104f6155929d6f0
parent9030377480effce89f382499ff47a22467112436
linux: Use INTERNAL_SYSCALL on fstatat{64}

Although not required by the standards, some code expects that a
successful stat call should not set errno.  However since aa03f722f3b99
'linux: Add {f}stat{at} y2038 support', on 32-bit systems with 32-bit
time_t supporrt, stat implementation will first issues __NR_statx and
if it fails with ENOSYS issue the system stat syscall.

On architecture running on kernel without __NR_statx support the
first call will set the errno to ENOSYS, even when the following stat
syscall might not fail.

This patch fixes by using INTERNAL_SYSCALL and only setting the errno
value when function returns.

Checked on i686-linux-gnu, x86_64-linux-gnu, sparc64-linux-gnu,
sparcv9-linux-gnu, powerpc64-linux-gnu, powerpc64le-linux-gnu,
arm-linux-gnueabihf, and aarch64-linux-gnu.
sysdeps/unix/sysv/linux/fstatat.c
sysdeps/unix/sysv/linux/fstatat64.c
sysdeps/unix/sysv/linux/mips/mips64/kstat_cp.h
sysdeps/unix/sysv/linux/sparc/sparc64/kstat_cp.h
This page took 0.043414 seconds and 5 git commands to generate.