public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] linux: use statx for fstat if neither newfstatat nor fstatat64 is present
@ 2022-05-24  8:11 caiyinyu
  2022-05-27 15:42 ` Adhemerval Zanella
  0 siblings, 1 reply; 3+ messages in thread
From: caiyinyu @ 2022-05-24  8:11 UTC (permalink / raw)
  To: libc-alpha; +Cc: joseph_myers, adhemerval.zanella, git

From: WANG Xuerui <git@xen0n.name>

LoongArch is going to be the first architecture supported by Linux that
has neither fstat* nor newfstatat [1], instead exclusively relying on
statx. So in fstatat64's implementation, we need to also enable statx
usage if neither fstatat64 nor newfstatat is present, to prepare for
this new case of kernel ABI.

[1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/
---
 sysdeps/unix/sysv/linux/fstatat64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
index 2ab914380d..8b1a1a290d 100644
--- a/sysdeps/unix/sysv/linux/fstatat64.c
+++ b/sysdeps/unix/sysv/linux/fstatat64.c
@@ -42,7 +42,8 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
 
 #if (__WORDSIZE == 32 \
      && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
-     || defined STAT_HAS_TIME32
+     || defined STAT_HAS_TIME32 \
+     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
 # define FSTATAT_USE_STATX 1
 
 static inline int
-- 
2.31.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] linux: use statx for fstat if neither newfstatat nor fstatat64 is present
  2022-05-24  8:11 [PATCH] linux: use statx for fstat if neither newfstatat nor fstatat64 is present caiyinyu
@ 2022-05-27 15:42 ` Adhemerval Zanella
  0 siblings, 0 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2022-05-27 15:42 UTC (permalink / raw)
  To: caiyinyu, libc-alpha; +Cc: joseph_myers, git



On 24/05/2022 05:11, caiyinyu wrote:
> From: WANG Xuerui <git@xen0n.name>
> 
> LoongArch is going to be the first architecture supported by Linux that
> has neither fstat* nor newfstatat [1], instead exclusively relying on
> statx. So in fstatat64's implementation, we need to also enable statx
> usage if neither fstatat64 nor newfstatat is present, to prepare for
> this new case of kernel ABI.
> 
> [1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/

LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

> ---
>  sysdeps/unix/sysv/linux/fstatat64.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
> index 2ab914380d..8b1a1a290d 100644
> --- a/sysdeps/unix/sysv/linux/fstatat64.c
> +++ b/sysdeps/unix/sysv/linux/fstatat64.c
> @@ -42,7 +42,8 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
>  
>  #if (__WORDSIZE == 32 \
>       && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
> -     || defined STAT_HAS_TIME32
> +     || defined STAT_HAS_TIME32 \
> +     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
>  # define FSTATAT_USE_STATX 1
>  
>  static inline int

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] linux: use statx for fstat if neither newfstatat nor fstatat64 is present
@ 2022-05-22  4:03 WANG Xuerui
  0 siblings, 0 replies; 3+ messages in thread
From: WANG Xuerui @ 2022-05-22  4:03 UTC (permalink / raw)
  To: libc-alpha; +Cc: WANG Xuerui

LoongArch is going to be the first architecture supported by Linux that
has neither fstat* nor newfstatat [1], instead exclusively relying on
statx. So in fstatat64's implementation, we need to also enable statx
usage if neither fstatat64 nor newfstatat is present, to prepare for
this new case of kernel ABI.

[1]: https://lore.kernel.org/all/20220518092619.1269111-1-chenhuacai@loongson.cn/
---
 sysdeps/unix/sysv/linux/fstatat64.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sysdeps/unix/sysv/linux/fstatat64.c b/sysdeps/unix/sysv/linux/fstatat64.c
index 2ab914380d..8b1a1a290d 100644
--- a/sysdeps/unix/sysv/linux/fstatat64.c
+++ b/sysdeps/unix/sysv/linux/fstatat64.c
@@ -42,7 +42,8 @@ _Static_assert (sizeof (__blkcnt_t) == sizeof (__blkcnt64_t),
 
 #if (__WORDSIZE == 32 \
      && (!defined __SYSCALL_WORDSIZE || __SYSCALL_WORDSIZE == 32)) \
-     || defined STAT_HAS_TIME32
+     || defined STAT_HAS_TIME32 \
+     || (!defined __NR_newfstatat && !defined __NR_fstatat64)
 # define FSTATAT_USE_STATX 1
 
 static inline int
-- 
2.35.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-05-27 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-24  8:11 [PATCH] linux: use statx for fstat if neither newfstatat nor fstatat64 is present caiyinyu
2022-05-27 15:42 ` Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2022-05-22  4:03 WANG Xuerui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).