From: Dmitry V. Levin Date: Tue, 9 Aug 2016 09:50:13 +0000 (+0000) Subject: file.c: move definitions of struct stat32 to separate files X-Git-Tag: v4.14~212 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09dee9ab254133af585f08a5fb5b9d40faaca4be;p=strace 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. --- diff --git a/Makefile.am b/Makefile.am index cb0bd92c..3125a572 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 bf957102..123af466 100644 --- a/file.c +++ b/file.c @@ -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 diff --git a/linux/aarch64/stat32.h b/linux/aarch64/stat32.h new file mode 100644 index 00000000..802610e4 --- /dev/null +++ b/linux/aarch64/stat32.h @@ -0,0 +1 @@ +#include "x86_64/stat32.h" diff --git a/linux/powerpc64/stat32.h b/linux/powerpc64/stat32.h new file mode 100644 index 00000000..d003b2aa --- /dev/null +++ b/linux/powerpc64/stat32.h @@ -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 index 00000000..b331940c --- /dev/null +++ b/linux/sparc64/stat32.h @@ -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 index 00000000..b6fedf6d --- /dev/null +++ b/linux/tile/stat32.h @@ -0,0 +1 @@ +/* no 32-bit stat */ diff --git a/linux/x32/stat32.h b/linux/x32/stat32.h new file mode 100644 index 00000000..802610e4 --- /dev/null +++ b/linux/x32/stat32.h @@ -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 index 00000000..3bde11a9 --- /dev/null +++ b/linux/x86_64/stat32.h @@ -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 */