aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-07-15 12:42:32 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-09-11 14:35:07 -0300
commit90e1600f4f9e3a3dcbf0a91e23098b052c975a9d (patch)
treeb2b8212e1811fce74f22a9d718abb9984517a4ee
parentc71d13a0984f677b294ee62eb0dd372e4ee5b32b (diff)
downloadglibc-90e1600f4f9e3a3dcbf0a91e23098b052c975a9d.zip
glibc-90e1600f4f9e3a3dcbf0a91e23098b052c975a9d.tar.gz
glibc-90e1600f4f9e3a3dcbf0a91e23098b052c975a9d.tar.bz2
linux: Always define STAT_IS_KERNEL_STAT
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>
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat.c4
-rw-r--r--sysdeps/unix/sysv/linux/hppa/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/mips/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h1
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c2
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.c2
-rw-r--r--sysdeps/unix/sysv/linux/xstatconv.h2
14 files changed, 15 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
index d637e09..9bcc96c 100644
--- a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index ce474dc..a88404b 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
index 3eb898e..937fec4 100644
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/fxstatat.c
@@ -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);
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
index a3ac53a..0cbd010 100644
--- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h
index eecc962..ff54a45 100644
--- a/sysdeps/unix/sysv/linux/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index e0cfc4f..dcd6858 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
index 765e0dc..4daaedc 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
index 388df1b..e75f3e8 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
@@ -56,5 +56,6 @@ struct kernel_stat
};
#endif
+#define STAT_IS_KERNEL_STAT 0
#define XSTAT_IS_XSTAT64 0
#define STATFS_IS_STATFS64 0
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
index c5948a4..75610b8 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
index a441600..5c8caca 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
index 30afb55..d14b248 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc64/kernel_stat.h
@@ -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
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index a93d635..76c90e2 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/xstatconv.c b/sysdeps/unix/sysv/linux/xstatconv.c
index c01fb00a..3622a82 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/xstatconv.c
@@ -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;
diff --git a/sysdeps/unix/sysv/linux/xstatconv.h b/sysdeps/unix/sysv/linux/xstatconv.h
index 39102c9..5319236 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.h
+++ b/sysdeps/unix/sysv/linux/xstatconv.h
@@ -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)