tree-wide: drop workarounds for statx()

struct statx in glibc header was introduced in glibc-2.28
(fd70af45528d59a00eb3190ef6706cb299488fcd), but at that time,
sys/stat.h conflicts with linux/stat.h. Since glibc-2.30
(5dad6ffbb2b76215cfcd38c3001778536ada8e8a), sys/stat.h includes
linux/stat.h if exists.

Since now our baseline of glibc is 2.31. Hence, we can drop workarounds
for struct statx by importing linux/stat.h from newer kernel (v6.14-rc4).
This commit is contained in:
Yu Watanabe
2025-03-01 00:33:28 +09:00
parent 24845c4ff6
commit 4424e6c811
15 changed files with 298 additions and 317 deletions
-23
View File
@@ -19,7 +19,6 @@
#include "macro.h"
#include "missing_keyctl.h"
#include "missing_sched.h"
#include "missing_stat.h"
#include "missing_syscall_def.h"
/* ======================================================================= */
@@ -223,28 +222,6 @@ static inline int missing_bpf(int cmd, union bpf_attr *attr, size_t size) {
/* ======================================================================= */
#if !HAVE_STATX
struct statx;
static inline ssize_t missing_statx(int dfd, const char *filename, unsigned flags, unsigned int mask, struct statx *buffer) {
# ifdef __NR_statx
return syscall(__NR_statx, dfd, filename, flags, mask, buffer);
# else
errno = ENOSYS;
return -1;
# endif
}
#endif
/* This typedef is supposed to be always defined. */
typedef struct statx struct_statx;
#if !HAVE_STATX
# define statx(dfd, filename, flags, mask, buffer) missing_statx(dfd, filename, flags, mask, buffer)
#endif
/* ======================================================================= */
#if !HAVE_SET_MEMPOLICY
enum {
MPOL_DEFAULT,