LoongArch: Undef __NR_fstat and __NR_newfstatat.

Message ID 20240914073552.2976703-1-caiyinyu@loongson.cn
State Changes Requested
Headers
Series LoongArch: Undef __NR_fstat and __NR_newfstatat. |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
redhat-pt-bot/TryBot-32bit success Build for i686
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed

Commit Message

caiyinyu Sept. 14, 2024, 7:35 a.m. UTC
  In Linux 6.11, fstat and newfstatat are added back. To avoid the messy
usage of the fstat, newfstatat, and statx system calls, we will continue
using statx only in glibc, maintaining consistency with previous versions of
the LoongArch-specific glibc implementation.

Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
Reviewed-by: Xi Ruoyao <xry111@xry111.site>
Reviewed-by: Miao Wang <shankerwangmiao@gmail.com>
---
 sysdeps/unix/sysv/linux/loongarch/sysdep.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Florian Weimer Sept. 23, 2024, 3:09 p.m. UTC | #1
> In Linux 6.11, fstat and newfstatat are added back. To avoid the messy
> usage of the fstat, newfstatat, and statx system calls, we will continue
> using statx only in glibc, maintaining consistency with previous versions of
> the LoongArch-specific glibc implementation.
>
> Signed-off-by: caiyinyu <caiyinyu@loongson.cn>
> Reviewed-by: Xi Ruoyao <xry111@xry111.site>
> Reviewed-by: Miao Wang <shankerwangmiao@gmail.com>
> ---
>  sysdeps/unix/sysv/linux/loongarch/sysdep.h | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
> index eb0ba790da..8a6c33de38 100644
> --- a/sysdeps/unix/sysv/linux/loongarch/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
> @@ -109,6 +109,11 @@
>  #undef SYS_ify
>  #define SYS_ify(syscall_name) __NR_##syscall_name
>  
> +/* To avoid the messy usage of the fstat, newfstatat, and statx system calls, we
> +only use statx.  */
> +#undef __NR_fstat
> +#undef __NR_newfstatat
> +
>  #ifndef __ASSEMBLER__
>  
>  #define VDSO_NAME "LINUX_5.10"

I think this is better handled via <fixup-asm-unistd.h>; see
sysdeps/unix/sysv/linux/arc/fixup-asm-unistd.h for an example.  The
generator script will take this into account when producing
arch-syscall.h.

Thanks,
Florian
  

Patch

diff --git a/sysdeps/unix/sysv/linux/loongarch/sysdep.h b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
index eb0ba790da..8a6c33de38 100644
--- a/sysdeps/unix/sysv/linux/loongarch/sysdep.h
+++ b/sysdeps/unix/sysv/linux/loongarch/sysdep.h
@@ -109,6 +109,11 @@ 
 #undef SYS_ify
 #define SYS_ify(syscall_name) __NR_##syscall_name
 
+/* To avoid the messy usage of the fstat, newfstatat, and statx system calls, we
+only use statx.  */
+#undef __NR_fstat
+#undef __NR_newfstatat
+
 #ifndef __ASSEMBLER__
 
 #define VDSO_NAME "LINUX_5.10"