]> granicus.if.org Git - strace/commitdiff
file.c: move definitions of struct stat32 to separate files
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 9 Aug 2016 09:50:13 +0000 (09:50 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Tue, 9 Aug 2016 10:27:50 +0000 (10:27 +0000)
* linux/aarch64/stat32.h: New file.
* linux/powerpc64/stat32.h: Likewise.
* linux/sparc64/stat32.h: Likewise.
* linux/tile/stat32.h: Likewise.
* linux/x32/stat32.h: Likewise.
* linux/x86_64/stat32.h: Likewise.
* Makefile.am (EXTRA_DIST): Add them.
* file.c [SUPPORTED_PERSONALITIES > 1]: Remove arch specific definitions
of struct stat32, include "stat32.h" instead.

Makefile.am
file.c
linux/aarch64/stat32.h [new file with mode: 0644]
linux/powerpc64/stat32.h [new file with mode: 0644]
linux/sparc64/stat32.h [new file with mode: 0644]
linux/tile/stat32.h [new file with mode: 0644]
linux/x32/stat32.h [new file with mode: 0644]
linux/x86_64/stat32.h [new file with mode: 0644]

index cb0bd92c9e983dcb73d38dca8cee8730e3388c17..3125a57241f6e5d0c6d6d81364446f7a1f089901 100644 (file)
@@ -302,6 +302,7 @@ EXTRA_DIST =                                \
        linux/aarch64/ioctls_inc0.h     \
        linux/aarch64/ioctls_inc1.h     \
        linux/aarch64/signalent1.h      \
+       linux/aarch64/stat32.h          \
        linux/aarch64/syscallent.h      \
        linux/aarch64/syscallent1.h     \
        linux/alpha/arch_getrval2.c     \
@@ -493,6 +494,7 @@ EXTRA_DIST =                                \
        linux/powerpc64/ioctls_inc0.h   \
        linux/powerpc64/ioctls_inc1.h   \
        linux/powerpc64/signalent1.h    \
+       linux/powerpc64/stat32.h        \
        linux/powerpc64/syscallent.h    \
        linux/powerpc64/syscallent1.h   \
        linux/powerpc64/userent.h       \
@@ -571,6 +573,7 @@ EXTRA_DIST =                                \
        linux/sparc64/ioctls_inc1.h     \
        linux/sparc64/signalent.h       \
        linux/sparc64/signalent1.h      \
+       linux/sparc64/stat32.h          \
        linux/sparc64/syscallent.h      \
        linux/sparc64/syscallent1.h     \
        linux/sparc64/userent.h         \
@@ -588,6 +591,7 @@ EXTRA_DIST =                                \
        linux/tile/ioctls_inc0.h        \
        linux/tile/ioctls_inc1.h        \
        linux/tile/signalent1.h         \
+       linux/tile/stat32.h             \
        linux/tile/syscallent.h         \
        linux/tile/syscallent1.h        \
        linux/tile/userent.h            \
@@ -607,6 +611,7 @@ EXTRA_DIST =                                \
        linux/x32/ioctls_inc0.h         \
        linux/x32/ioctls_inc1.h         \
        linux/x32/signalent1.h          \
+       linux/x32/stat32.h              \
        linux/x32/syscallent.h          \
        linux/x32/syscallent1.h         \
        linux/x32/userent.h             \
@@ -628,6 +633,7 @@ EXTRA_DIST =                                \
        linux/x86_64/ioctls_inc2.h      \
        linux/x86_64/signalent1.h       \
        linux/x86_64/signalent2.h       \
+       linux/x86_64/stat32.h           \
        linux/x86_64/syscallent.h       \
        linux/x86_64/syscallent1.h      \
        linux/x86_64/syscallent2.h      \
diff --git a/file.c b/file.c
index bf95710266e4142ac883077a7149aae3aaa15eac..123af4660a77caeb6a9e6ebc176530d026385002 100644 (file)
--- a/file.c
+++ b/file.c
 
 #undef STAT32_PERSONALITY
 #if SUPPORTED_PERSONALITIES > 1
-# if defined AARCH64 || defined X86_64 || defined X32
-struct stat32 {
-       unsigned int    st_dev;
-       unsigned int    st_ino;
-       unsigned short  st_mode;
-       unsigned short  st_nlink;
-       unsigned short  st_uid;
-       unsigned short  st_gid;
-       unsigned int    st_rdev;
-       unsigned int    st_size;
-       unsigned int    st_blksize;
-       unsigned int    st_blocks;
-       unsigned int    st_atime;
-       unsigned int    st_atime_nsec;
-       unsigned int    st_mtime;
-       unsigned int    st_mtime_nsec;
-       unsigned int    st_ctime;
-       unsigned int    st_ctime_nsec;
-       unsigned int    __unused4;
-       unsigned int    __unused5;
-};
-#  define STAT32_PERSONALITY 1
-# elif defined POWERPC64
-struct stat32 {
-       unsigned int    st_dev;
-       unsigned int    st_ino;
-       unsigned int    st_mode;
-       unsigned short  st_nlink;
-       unsigned int    st_uid;
-       unsigned int    st_gid;
-       unsigned int    st_rdev;
-       unsigned int    st_size;
-       unsigned int    st_blksize;
-       unsigned int    st_blocks;
-       unsigned int    st_atime;
-       unsigned int    st_atime_nsec;
-       unsigned int    st_mtime;
-       unsigned int    st_mtime_nsec;
-       unsigned int    st_ctime;
-       unsigned int    st_ctime_nsec;
-       unsigned int    __unused4;
-       unsigned int    __unused5;
-};
-#  define STAT32_PERSONALITY 1
-# elif defined SPARC64
-struct stat32 {
-       unsigned short  st_dev;
-       unsigned int    st_ino;
-       unsigned short  st_mode;
-       unsigned short  st_nlink;
-       unsigned short  st_uid;
-       unsigned short  st_gid;
-       unsigned short  st_rdev;
-       unsigned int    st_size;
-       unsigned int    st_atime;
-       unsigned int    st_atime_nsec;
-       unsigned int    st_mtime;
-       unsigned int    st_mtime_nsec;
-       unsigned int    st_ctime;
-       unsigned int    st_ctime_nsec;
-       unsigned int    st_blksize;
-       unsigned int    st_blocks;
-       unsigned int    __unused4[2];
-};
-#  define STAT32_PERSONALITY 1
-# elif defined SPARC
-#  /* no 64-bit personalities */
-# elif defined TILE
-#  /* no 32-bit stat */
-# else
-#  warning FIXME: check whether struct stat32 definition is needed for this architecture!
-# endif /* X86_64 || X32 || POWERPC64 */
-#endif /* SUPPORTED_PERSONALITIES > 1 */
+# include "stat32.h"
+#endif
 
 #ifdef STAT32_PERSONALITY
 # define DO_PRINTSTAT do_printstat32
diff --git a/linux/aarch64/stat32.h b/linux/aarch64/stat32.h
new file mode 100644 (file)
index 0000000..802610e
--- /dev/null
@@ -0,0 +1 @@
+#include "x86_64/stat32.h"
diff --git a/linux/powerpc64/stat32.h b/linux/powerpc64/stat32.h
new file mode 100644 (file)
index 0000000..d003b2a
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef STRACE_STAT32_H
+#define STRACE_STAT32_H
+
+struct stat32 {
+       unsigned int    st_dev;
+       unsigned int    st_ino;
+       unsigned int    st_mode;
+       unsigned short  st_nlink;
+       unsigned int    st_uid;
+       unsigned int    st_gid;
+       unsigned int    st_rdev;
+       unsigned int    st_size;
+       unsigned int    st_blksize;
+       unsigned int    st_blocks;
+       unsigned int    st_atime;
+       unsigned int    st_atime_nsec;
+       unsigned int    st_mtime;
+       unsigned int    st_mtime_nsec;
+       unsigned int    st_ctime;
+       unsigned int    st_ctime_nsec;
+       unsigned int    __unused4[2];
+};
+
+# define STAT32_PERSONALITY 1
+
+#endif /* !STRACE_STAT32_H */
diff --git a/linux/sparc64/stat32.h b/linux/sparc64/stat32.h
new file mode 100644 (file)
index 0000000..b331940
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef STRACE_STAT32_H
+#define STRACE_STAT32_H
+
+struct stat32 {
+       unsigned short  st_dev;
+       unsigned int    st_ino;
+       unsigned short  st_mode;
+       unsigned short  st_nlink;
+       unsigned short  st_uid;
+       unsigned short  st_gid;
+       unsigned short  st_rdev;
+       unsigned int    st_size;
+       unsigned int    st_atime;
+       unsigned int    st_atime_nsec;
+       unsigned int    st_mtime;
+       unsigned int    st_mtime_nsec;
+       unsigned int    st_ctime;
+       unsigned int    st_ctime_nsec;
+       unsigned int    st_blksize;
+       unsigned int    st_blocks;
+       unsigned int    __unused4[2];
+};
+
+# define STAT32_PERSONALITY 1
+
+#endif /* !STRACE_STAT32_H */
diff --git a/linux/tile/stat32.h b/linux/tile/stat32.h
new file mode 100644 (file)
index 0000000..b6fedf6
--- /dev/null
@@ -0,0 +1 @@
+/* no 32-bit stat */
diff --git a/linux/x32/stat32.h b/linux/x32/stat32.h
new file mode 100644 (file)
index 0000000..802610e
--- /dev/null
@@ -0,0 +1 @@
+#include "x86_64/stat32.h"
diff --git a/linux/x86_64/stat32.h b/linux/x86_64/stat32.h
new file mode 100644 (file)
index 0000000..3bde11a
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef STRACE_STAT32_H
+#define STRACE_STAT32_H
+
+struct stat32 {
+       unsigned int    st_dev;
+       unsigned int    st_ino;
+       unsigned short  st_mode;
+       unsigned short  st_nlink;
+       unsigned short  st_uid;
+       unsigned short  st_gid;
+       unsigned int    st_rdev;
+       unsigned int    st_size;
+       unsigned int    st_blksize;
+       unsigned int    st_blocks;
+       unsigned int    st_atime;
+       unsigned int    st_atime_nsec;
+       unsigned int    st_mtime;
+       unsigned int    st_mtime_nsec;
+       unsigned int    st_ctime;
+       unsigned int    st_ctime_nsec;
+       unsigned int    __unused4[2];
+};
+
+# define STAT32_PERSONALITY 1
+
+#endif /* !STRACE_STAT32_H */