Patchwork Always define XSTAT_IS_XSTAT64

login
register
mail settings
Submitter Steve Ellcey
Date Nov. 17, 2016, 8:47 p.m.
Message ID <201611172047.uAHKliIX011380@sellcey-lt.caveonetworks.com>
Download mbox | patch
Permalink /patch/17555/
State New
Headers show

Comments

Steve Ellcey - Nov. 17, 2016, 8:47 p.m.
This patch defines XSTAT_IS_XSTAT64 to be 0 in kernel_stat.h header files
where it is currently not defined and then changes the '#ifdef' checks of this
define to '#if'.  This is part of the glibc move to always defining 
macros and is something I would like to checkin before making more use
of XSTAT_IS_XSTAT64 in some header files changes for aarch64 ILP32.

Tested on x86 (32/x32/64 modes) and on aarch64.  OK to checkin?

Steve Ellcey
sellcey@caviumnetworks.com



2016-11-17  Steve Ellcey  <sellcey@caviumnetworks.com>

	* sysdeps/unix/sysv/linux/generic/kernel_stat.h: Set XSTAT_IS_XSTAT64
	to 0 when in 32 bit mode.
	* sysdeps/unix/sysv/linux/hppa/kernel_stat.h: Set XSTAT_IS_XSTAT64 to 0.
	* sysdeps/unix/sysv/linux/kernel_stat.h: Ditto.
	* sysdeps/unix/sysv/linux/microblaze/kernel_stat.h: Ditto.
	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Ditto.
	* sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: Ditto.
	* sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h: Ditto.
	* sysdeps/unix/sysv/linux/fxstat.c: Replace #ifdef with #if on
	XSTAT_IS_XSTAT64 test.
	* sysdeps/unix/sysv/linux/fxstatat.c: Ditto.
	* sysdeps/unix/sysv/linux/generic/lxstat.c: Ditto.
	* sysdeps/unix/sysv/linux/generic/xstat.c: Ditto.
	* sysdeps/unix/sysv/linux/i386/fxstat.c: Ditto.
	* sysdeps/unix/sysv/linux/i386/fxstatat.c: Ditto.
	* sysdeps/unix/sysv/linux/i386/lxstat.c: Ditto.
	* sysdeps/unix/sysv/linux/i386/xstat.c: Ditto.
	* sysdeps/unix/sysv/linux/lxstat.c: Ditto.
	* sysdeps/unix/sysv/linux/mips/xstatconv.c: Ditto.
	* sysdeps/unix/sysv/linux/xstat.c: Ditto.
	* sysdeps/unix/sysv/linux/xstatconv.c: Ditto.
Andreas Schwab - Nov. 21, 2016, 9:14 a.m.
On Nov 17 2016, Steve Ellcey <sellcey@cavium.com> wrote:

> 	* sysdeps/unix/sysv/linux/generic/kernel_stat.h: Set XSTAT_IS_XSTAT64
> 	to 0 when in 32 bit mode.
> 	* sysdeps/unix/sysv/linux/hppa/kernel_stat.h: Set XSTAT_IS_XSTAT64 to 0.
> 	* sysdeps/unix/sysv/linux/kernel_stat.h: Ditto.
> 	* sysdeps/unix/sysv/linux/microblaze/kernel_stat.h: Ditto.
> 	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Ditto.
> 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h: Ditto.
> 	* sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h: Ditto.
> 	* sysdeps/unix/sysv/linux/fxstat.c: Replace #ifdef with #if on
> 	XSTAT_IS_XSTAT64 test.
> 	* sysdeps/unix/sysv/linux/fxstatat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/generic/lxstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/generic/xstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/i386/fxstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/i386/fxstatat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/i386/lxstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/i386/xstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/lxstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/mips/xstatconv.c: Ditto.
> 	* sysdeps/unix/sysv/linux/xstat.c: Ditto.
> 	* sysdeps/unix/sysv/linux/xstatconv.c: Ditto.

Ok.

Andreas.

Patch

diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
index e33023b..d7a8064 100644
--- a/sysdeps/unix/sysv/linux/fxstat.c
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -54,7 +54,7 @@  __fxstat (int vers, int fd, struct stat *buf)
 
 hidden_def (__fxstat)
 weak_alias (__fxstat, _fxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __fxstat64
 strong_alias (__fxstat, __fxstat64);
 hidden_ver (__fxstat, __fxstat64)
diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c
index f716bf3..2e28f61 100644
--- a/sysdeps/unix/sysv/linux/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/fxstatat.c
@@ -58,7 +58,7 @@  __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
 								      err));
 }
 libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 # undef __fxstatat64
 strong_alias (__fxstatat, __fxstatat64);
 libc_hidden_def (__fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/generic/kernel_stat.h b/sysdeps/unix/sysv/linux/generic/kernel_stat.h
index be12819..5d5f04b 100644
--- a/sysdeps/unix/sysv/linux/generic/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/generic/kernel_stat.h
@@ -23,4 +23,6 @@ 
 /* We provide separate 32-bit API versions that check for EOVERFLOW. */
 #if __WORDSIZE == 64
 # define XSTAT_IS_XSTAT64 1
+#else
+# define XSTAT_IS_XSTAT64 0
 #endif
diff --git a/sysdeps/unix/sysv/linux/generic/lxstat.c b/sysdeps/unix/sysv/linux/generic/lxstat.c
index f97c2d5..653f6e9 100644
--- a/sysdeps/unix/sysv/linux/generic/lxstat.c
+++ b/sysdeps/unix/sysv/linux/generic/lxstat.c
@@ -41,7 +41,7 @@  __lxstat (int vers, const char *name, struct stat *buf)
 
 hidden_def (__lxstat)
 weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __lxstat64
 strong_alias (__lxstat, __lxstat64);
 hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/generic/xstat.c b/sysdeps/unix/sysv/linux/generic/xstat.c
index 3d82b87..5808b1a 100644
--- a/sysdeps/unix/sysv/linux/generic/xstat.c
+++ b/sysdeps/unix/sysv/linux/generic/xstat.c
@@ -41,7 +41,7 @@  __xstat (int vers, const char *name, struct stat *buf)
 
 hidden_def (__xstat)
 weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __xstat64
 strong_alias (__xstat, __xstat64);
 hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
index e3ea724..9ffa3ba 100644
--- a/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/hppa/kernel_stat.h
@@ -29,3 +29,5 @@  struct kernel_stat {
 
 #define _HAVE_STAT_NSEC
 #define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/i386/fxstat.c b/sysdeps/unix/sysv/linux/i386/fxstat.c
index b21dced..6fd0c76 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstat.c
@@ -54,7 +54,7 @@  __fxstat (int vers, int fd, struct stat *buf)
 
 hidden_def (__fxstat)
 weak_alias (__fxstat, _fxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __fxstat64
 strong_alias (__fxstat, __fxstat64);
 hidden_ver (__fxstat, __fxstat64)
diff --git a/sysdeps/unix/sysv/linux/i386/fxstatat.c b/sysdeps/unix/sysv/linux/i386/fxstatat.c
index 5f7ac56..2466e6c 100644
--- a/sysdeps/unix/sysv/linux/i386/fxstatat.c
+++ b/sysdeps/unix/sysv/linux/i386/fxstatat.c
@@ -49,7 +49,7 @@  __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
     return __xstat32_conv (vers, &st64, st);
 }
 libc_hidden_def (__fxstatat)
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 # undef __fxstatat64
 strong_alias (__fxstatat, __fxstatat64);
 libc_hidden_ver (__fxstatat, __fxstatat64)
diff --git a/sysdeps/unix/sysv/linux/i386/lxstat.c b/sysdeps/unix/sysv/linux/i386/lxstat.c
index 445d154..b6e9259 100644
--- a/sysdeps/unix/sysv/linux/i386/lxstat.c
+++ b/sysdeps/unix/sysv/linux/i386/lxstat.c
@@ -55,7 +55,7 @@  __lxstat (int vers, const char *name, struct stat *buf)
 
 hidden_def (__lxstat)
 weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __lxstat64
 strong_alias (__lxstat, __lxstat64);
 hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/i386/xstat.c b/sysdeps/unix/sysv/linux/i386/xstat.c
index 915a80e..788d458 100644
--- a/sysdeps/unix/sysv/linux/i386/xstat.c
+++ b/sysdeps/unix/sysv/linux/i386/xstat.c
@@ -54,7 +54,7 @@  __xstat (int vers, const char *name, struct stat *buf)
 }
 hidden_def (__xstat)
 weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 # undef __xstat64
 strong_alias (__xstat, __xstat64);
 hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h
index dcdab48..4354d14 100644
--- a/sysdeps/unix/sysv/linux/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/kernel_stat.h
@@ -33,3 +33,5 @@  struct kernel_stat
 #define _HAVE_STAT64___PAD2
 #define _HAVE_STAT64___ST_INO
 #define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
index c8bf06d..59aceb4 100644
--- a/sysdeps/unix/sysv/linux/lxstat.c
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -53,7 +53,7 @@  __lxstat (int vers, const char *name, struct stat *buf)
 
 hidden_def (__lxstat)
 weak_alias (__lxstat, _lxstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __lxstat64
 strong_alias (__lxstat, __lxstat64);
 hidden_ver (__lxstat, __lxstat64)
diff --git a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
index edcc15d..b6ae8c3 100644
--- a/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/microblaze/kernel_stat.h
@@ -47,3 +47,5 @@  struct kernel_stat
 #define _HAVE_STAT___UNUSED5
 #define _HAVE_STAT64___UNUSED5
 };
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/mips/kernel_stat.h b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
index e785bcd..a41d15f 100644
--- a/sysdeps/unix/sysv/linux/mips/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/mips/kernel_stat.h
@@ -55,3 +55,5 @@  struct kernel_stat
     unsigned int st_gen;
   };
 #endif
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/mips/xstatconv.c b/sysdeps/unix/sysv/linux/mips/xstatconv.c
index 4f05630..8d20080 100644
--- a/sysdeps/unix/sysv/linux/mips/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/mips/xstatconv.c
@@ -91,7 +91,7 @@  __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 int
 __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 {
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
   return xstat_conv (vers, kbuf, ubuf);
 #else
   switch (vers)
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
index 75f7bcd..0fbde98 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/kernel_stat.h
@@ -46,3 +46,5 @@  struct kernel_stat
 #define _HAVE_STAT64___UNUSED5
 #define _HAVE_STAT64___PAD2
 #define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
index 5b894b8..eb60236 100644
--- a/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/sparc32/kernel_stat.h
@@ -30,3 +30,5 @@  struct kernel_stat
 #define _HAVE_STAT64___PAD2
 #define _HAVE_STAT_NSEC
 #define _HAVE_STAT64_NSEC
+
+#define XSTAT_IS_XSTAT64 0
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
index cbd5aeb..41e4b35 100644
--- a/sysdeps/unix/sysv/linux/xstat.c
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -52,7 +52,7 @@  __xstat (int vers, const char *name, struct stat *buf)
 }
 hidden_def (__xstat)
 weak_alias (__xstat, _xstat);
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 #undef __xstat64
 strong_alias (__xstat, __xstat64);
 hidden_ver (__xstat, __xstat64)
diff --git a/sysdeps/unix/sysv/linux/xstatconv.c b/sysdeps/unix/sysv/linux/xstatconv.c
index 27b528c..fd4d874 100644
--- a/sysdeps/unix/sysv/linux/xstatconv.c
+++ b/sysdeps/unix/sysv/linux/xstatconv.c
@@ -31,7 +31,7 @@  struct kernel_stat;
 #include <string.h>
 
 
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
 int
 __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 {
@@ -106,7 +106,7 @@  __xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 int
 __xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 {
-#ifdef XSTAT_IS_XSTAT64
+#if XSTAT_IS_XSTAT64
   return __xstat_conv (vers, kbuf, ubuf);
 #else
   switch (vers)