diff options
author | Florian Weimer <fweimer@redhat.com> | 2018-07-10 16:14:45 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2018-07-10 16:14:45 +0200 |
commit | fd70af45528d59a00eb3190ef6706cb299488fcd (patch) | |
tree | 9782185e343e716c4af641cc16ece3ffd5c38ebf /sysdeps/unix/sysv | |
parent | b444e8f7cc40265c9a20ce5de5f3f6795b7f5028 (diff) | |
download | glibc-fd70af45528d59a00eb3190ef6706cb299488fcd.zip glibc-fd70af45528d59a00eb3190ef6706cb299488fcd.tar.gz glibc-fd70af45528d59a00eb3190ef6706cb299488fcd.tar.bz2 |
Add the statx function
Diffstat (limited to 'sysdeps/unix/sysv')
31 files changed, 85 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist index 7a272a1..e92cd0a 100644 --- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist +++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist @@ -2133,3 +2133,4 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F diff --git a/sysdeps/unix/sysv/linux/alpha/kernel-features.h b/sysdeps/unix/sysv/linux/alpha/kernel-features.h index 5781cff..f63be39 100644 --- a/sysdeps/unix/sysv/linux/alpha/kernel-features.h +++ b/sysdeps/unix/sysv/linux/alpha/kernel-features.h @@ -45,4 +45,9 @@ # undef __ASSUME_EXECVEAT #endif +/* Support for statx was added in kernel 4.13. */ +#if __LINUX_KERNEL_VERSION < 0x040D00 +# undef __ASSUME_STATX +#endif + #endif /* _KERNEL_FEATURES_H */ diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist index 23fec55..ba94739 100644 --- a/sysdeps/unix/sysv/linux/alpha/libc.abilist +++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist @@ -2028,6 +2028,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/arm/libc.abilist b/sysdeps/unix/sysv/linux/arm/libc.abilist index b203160..dc71f1b 100644 --- a/sysdeps/unix/sysv/linux/arm/libc.abilist +++ b/sysdeps/unix/sysv/linux/arm/libc.abilist @@ -118,6 +118,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0xa0 GLIBC_2.4 _IO_2_1_stdin_ D 0xa0 diff --git a/sysdeps/unix/sysv/linux/hppa/libc.abilist b/sysdeps/unix/sysv/linux/hppa/libc.abilist index 64809ca..6a34090 100644 --- a/sysdeps/unix/sysv/linux/hppa/libc.abilist +++ b/sysdeps/unix/sysv/linux/hppa/libc.abilist @@ -1875,6 +1875,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/i386/libc.abilist b/sysdeps/unix/sysv/linux/i386/libc.abilist index 4a87f62..30f8ddc 100644 --- a/sysdeps/unix/sysv/linux/i386/libc.abilist +++ b/sysdeps/unix/sysv/linux/i386/libc.abilist @@ -2040,6 +2040,7 @@ GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h index 04cdf43..4fde73f 100644 --- a/sysdeps/unix/sysv/linux/ia64/kernel-features.h +++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -26,6 +26,9 @@ #define __ASSUME_SEND_SYSCALL 1 #define __ASSUME_ACCEPT4_SYSCALL 1 +/* No statx system call on ia64 yet. */ +#undef __ASSUME_STATX + #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE2 diff --git a/sysdeps/unix/sysv/linux/ia64/libc.abilist b/sysdeps/unix/sysv/linux/ia64/libc.abilist index 6bdd0d0..8f7aaff 100644 --- a/sysdeps/unix/sysv/linux/ia64/libc.abilist +++ b/sysdeps/unix/sysv/linux/ia64/libc.abilist @@ -1909,6 +1909,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h index 86fc665..5543d92 100644 --- a/sysdeps/unix/sysv/linux/kernel-features.h +++ b/sysdeps/unix/sysv/linux/kernel-features.h @@ -115,6 +115,11 @@ # define __ASSUME_COPY_FILE_RANGE 1 #endif +/* Support for statx was added in kernel 4.11. */ +#if __LINUX_KERNEL_VERSION >= 0x040B00 +# define __ASSUME_STATX 1 +#endif + /* Support for clone call used on fork. The signature varies across the architectures with current 4 different variants: diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist index 3226f91..1b057ec 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist @@ -119,6 +119,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.4 _Exit F GLIBC_2.4 _IO_2_1_stderr_ D 0x98 GLIBC_2.4 _IO_2_1_stdin_ D 0x98 diff --git a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist index b1074ee..70232f2 100644 --- a/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist +++ b/sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist @@ -1984,6 +1984,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h index 7db3d05..e8e2ac6 100644 --- a/sysdeps/unix/sysv/linux/microblaze/kernel-features.h +++ b/sysdeps/unix/sysv/linux/microblaze/kernel-features.h @@ -63,5 +63,10 @@ # undef __ASSUME_COPY_FILE_RANGE #endif +/* Support for statx was added in kernel 4.12. */ +#if __LINUX_KERNEL_VERSION < 0X040C00 +# undef __ASSUME_STATX +#endif + #undef __ASSUME_CLONE_DEFAULT #define __ASSUME_CLONE_BACKWARDS3 diff --git a/sysdeps/unix/sysv/linux/microblaze/libc.abilist b/sysdeps/unix/sysv/linux/microblaze/libc.abilist index b52fc7d..6f29578 100644 --- a/sysdeps/unix/sysv/linux/microblaze/libc.abilist +++ b/sysdeps/unix/sysv/linux/microblaze/libc.abilist @@ -2125,3 +2125,4 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist index 718c742..88f79b7 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist @@ -1962,6 +1962,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist index 9b218a9..563b310 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist @@ -1960,6 +1960,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist index 5a90ab8..5cdf8c2 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist @@ -1968,6 +1968,7 @@ GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist index 3005fc9..ce27832 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist +++ b/sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist @@ -1963,6 +1963,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/nios2/libc.abilist b/sysdeps/unix/sysv/linux/nios2/libc.abilist index a87fbbe..78cc9cf 100644 --- a/sysdeps/unix/sysv/linux/nios2/libc.abilist +++ b/sysdeps/unix/sysv/linux/nios2/libc.abilist @@ -2166,3 +2166,4 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist index d56f776..9ae40a9 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist @@ -1988,6 +1988,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist index 2b5337a..863f85b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist @@ -1992,6 +1992,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist index d0dfde3..4cc5a44 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc-le.abilist @@ -2223,3 +2223,4 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist index d505ae0..a3cd322 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/libc.abilist @@ -118,6 +118,7 @@ GLIBC_2.27 wcstof64 F GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 _Exit F GLIBC_2.3 _IO_2_1_stderr_ D 0xe0 GLIBC_2.3 _IO_2_1_stdin_ D 0xe0 diff --git a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist index 33f751a..f094b0f 100644 --- a/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist +++ b/sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist @@ -2095,3 +2095,4 @@ GLIBC_2.27 xprt_register F GLIBC_2.27 xprt_unregister F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist index c4ec93f..26a95e6 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist @@ -1997,6 +1997,7 @@ GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist index 2a6a0ab..650385b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist +++ b/sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist @@ -1902,6 +1902,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/sh/libc.abilist b/sysdeps/unix/sysv/linux/sh/libc.abilist index 8de0d17..cd349cc 100644 --- a/sysdeps/unix/sysv/linux/sh/libc.abilist +++ b/sysdeps/unix/sysv/linux/sh/libc.abilist @@ -1879,6 +1879,7 @@ GLIBC_2.27 wcstof64_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist index 9858460..e043840 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist @@ -1991,6 +1991,7 @@ GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist index a22b8fb..9f036dd 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist @@ -1932,6 +1932,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/statx.c b/sysdeps/unix/sysv/linux/statx.c new file mode 100644 index 0000000..76761d6 --- /dev/null +++ b/sysdeps/unix/sysv/linux/statx.c @@ -0,0 +1,41 @@ +/* Linux statx implementation. + Copyright (C) 2018 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#include <errno.h> +#include <sys/stat.h> + +#include "statx_generic.c" + +int +statx (int fd, const char *path, int flags, + unsigned int mask, struct statx *buf) +{ +#ifdef __NR_statx + int ret = INLINE_SYSCALL_CALL (statx, fd, path, flags, mask, buf); +# ifdef __ASSUME_STATX + return ret; +# else + if (ret == 0 || errno != ENOSYS) + /* Preserve non-error/non-ENOSYS return values. */ + return ret; +# endif +#endif +#ifndef __ASSUME_STATX + return statx_generic (fd, path, flags, mask, buf); +#endif +} diff --git a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist index d5d71cc..2df20eb 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/64/libc.abilist @@ -1890,6 +1890,7 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F GLIBC_2.3 __ctype_b_loc F GLIBC_2.3 __ctype_tolower_loc F GLIBC_2.3 __ctype_toupper_loc F diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist index e6ad424..83e15f8 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist +++ b/sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist @@ -2141,3 +2141,4 @@ GLIBC_2.27 wcstof64x F GLIBC_2.27 wcstof64x_l F GLIBC_2.28 fcntl64 F GLIBC_2.28 renameat2 F +GLIBC_2.28 statx F |