file.c: move definitions of struct stat32 to separate files

* 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.
This commit is contained in:
Дмитрий Левин 2016-08-09 09:50:13 +00:00
parent 5179183b49
commit 09dee9ab25
8 changed files with 89 additions and 73 deletions

View 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 \

75
file.c
View File

@ -97,79 +97,8 @@
#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

1
linux/aarch64/stat32.h Normal file
View File

@ -0,0 +1 @@
#include "x86_64/stat32.h"

26
linux/powerpc64/stat32.h Normal file
View File

@ -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 */

26
linux/sparc64/stat32.h Normal file
View File

@ -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 */

1
linux/tile/stat32.h Normal file
View File

@ -0,0 +1 @@
/* no 32-bit stat */

1
linux/x32/stat32.h Normal file
View File

@ -0,0 +1 @@
#include "x86_64/stat32.h"

26
linux/x86_64/stat32.h Normal file
View File

@ -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 */