Skip to content

Commit

Permalink
linux: use statx for fstat if neither newfstatat nor fstatat64 is pre…
Browse files Browse the repository at this point in the history
…sent

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/

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
  • Loading branch information
xen0n authored and zatrazz committed Jun 1, 2022
1 parent de3501d commit e6547d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sysdeps/unix/sysv/linux/fstatat64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6547d6

Please sign in to comment.