]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
linux: Always define STAT_IS_KERNEL_STAT
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 15 Jul 2020 12:42:32 +0000 (12:42 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 11 Sep 2020 17:35:07 +0000 (14:35 -0300)
It allows to check for its value instead of its existence.

Checked with a build for all affected ABIS.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
14 files changed:
sysdeps/unix/sysv/linux/alpha/kernel_stat.h
sysdeps/unix/sysv/linux/fxstat.c
sysdeps/unix/sysv/linux/fxstatat.c
sysdeps/unix/sysv/linux/hppa/kernel_stat.h
sysdeps/unix/sysv/linux/kernel_stat.h
sysdeps/unix/sysv/linux/lxstat.c
sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
sysdeps/unix/sysv/linux/mips/kernel_stat.h
sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
sysdeps/unix/sysv/linux/xstat.c
sysdeps/unix/sysv/linux/xstatconv.c
sysdeps/unix/sysv/linux/xstatconv.h

index d637e099cfe42a2a0c9f334c9f7dd857a3128e24..9bcc96c5773434c701690c1189ba4efef940bec2 100644 (file)
@@ -85,5 +85,6 @@ struct glibc21_stat
     long __glibc_reserved[4];
   };
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 1
 #define STATFS_IS_STATFS64 0
index ce474dcd47063dc77ddacc8639d169988e86971f..a88404b5c30a4635afd46a8498fa17cd2598780c 100644 (file)
@@ -38,7 +38,7 @@ __fxstat (int vers, int fd, struct stat *buf)
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL (fstat, 2, fd, buf);
 
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 #else
   struct kernel_stat kbuf;
index 3eb898e322a3a2d4946bd6785dbeda9986217e25..937fec45c279326604ab8ac1df4e1110bddba435 100644 (file)
@@ -37,7 +37,7 @@ int
 __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 {
   int result;
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
 # define kst (*st)
 #else
   struct kernel_stat kst;
@@ -46,7 +46,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
   result = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag);
   if (!__glibc_likely (INTERNAL_SYSCALL_ERROR_P (result)))
     {
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
       return 0;
 #else
       return __xstat_conv (vers, &kst, st);
index a3ac53a1ef2f20e3361055a84a919bc71751cd30..0cbd010fc34e8e4fadc3d24decef17d455753b67 100644 (file)
@@ -30,5 +30,6 @@ struct kernel_stat {
 #define _HAVE_STAT_NSEC
 #define _HAVE_STAT64_NSEC
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index eecc962de390d0be1e5a6f277dac4b79918862ce..ff54a4524c01b26ed7270b817cffe1593cb1214f 100644 (file)
@@ -34,5 +34,6 @@ struct kernel_stat
 #define _HAVE_STAT64___ST_INO
 #define _HAVE_STAT64_NSEC
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index e0cfc4f1fa16624abe7cbe3042f4fbeefc2dad7c..dcd685873d018e5d593c85627645f5f5788dfda8 100644 (file)
@@ -37,7 +37,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL (lstat, 2, name, buf);
 
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 #else
   struct kernel_stat kbuf;
index 765e0dca676314981b33fdb5eb138d87776dbeaf..4daaedc4b61d43210f17a55d3b88749e5b29bbf5 100644 (file)
@@ -48,5 +48,6 @@ struct kernel_stat
 #define _HAVE_STAT64___UNUSED5
 };
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index 388df1bfffecb3deeaa64ff2a0b14973f393e28d..e75f3e805b38145cca4a6ce9df155a16d6fb0040 100644 (file)
@@ -56,5 +56,6 @@ struct kernel_stat
   };
 #endif
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index c5948a4d3c1c04d380c1c7702bdac2ffd6b24d1f..75610b8df3fcdec031055fbdf365f600badedc9c 100644 (file)
@@ -47,5 +47,6 @@ struct kernel_stat
 #define _HAVE_STAT64___PAD2
 #define _HAVE_STAT64_NSEC
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index a4416009f1bc4a8a6cffb42da06291ea1dcf2508..5c8cacaf67cb8aa83906c33156b69d19b4098592 100644 (file)
@@ -31,5 +31,6 @@ struct kernel_stat
 #define _HAVE_STAT_NSEC
 #define _HAVE_STAT64_NSEC
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 0
 #define STATFS_IS_STATFS64 0
index 30afb553b9b8dd53773e6f7bd5e5b54d5e9a4f8f..d14b2487ac78908fd3ae528eb9304f1dc950bc58 100644 (file)
@@ -44,5 +44,6 @@ struct kernel_stat64
     long int __glibc_reserved[3];
   };
 
+#define STAT_IS_KERNEL_STAT 0
 #define XSTAT_IS_XSTAT64 1
 #define STATFS_IS_STATFS64 0
index a93d63561165f45b55af9de0a14aa34d5f3afe0d..76c90e20c7822e6c7a5a346464bd6fb65fb53c3f 100644 (file)
@@ -37,7 +37,7 @@ __xstat (int vers, const char *name, struct stat *buf)
   if (vers == _STAT_VER_KERNEL)
     return INLINE_SYSCALL (stat, 2, name, buf);
 
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
   return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL);
 #else
   struct kernel_stat kbuf;
index c01fb00a3a1fd14afa1a190ef2dce351b79276a1..3622a82cd099875b4f1adcceff1eddb865133d3a 100644 (file)
@@ -20,7 +20,7 @@
 #include <sys/stat.h>
 #include <kernel_stat.h>
 
-#ifdef STAT_IS_KERNEL_STAT
+#if STAT_IS_KERNEL_STAT
 
 /* Dummy.  */
 struct kernel_stat;
index 39102c94696664ce7d201f655998c5e399597532..5319236caebcfe01cb049fbfd3afcdde7c2a8289 100644 (file)
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#ifndef STAT_IS_KERNEL_STAT
+#if !STAT_IS_KERNEL_STAT
 extern int __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
   attribute_hidden;
 extern int __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)