]> granicus.if.org Git - strace/commitdiff
Cleanup after non-Linux code removal.
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 25 Feb 2012 01:38:52 +0000 (02:38 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 25 Feb 2012 01:38:52 +0000 (02:38 +0100)
Conditions such as defined(LINUX) are always true now,
defined(FREEBSD) etc are always false.
When if directive has them as subexpressions, it can be simplified.
Another trivial changes here are fixes for directive indentation.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
15 files changed:
defs.h
desc.c
file.c
io.c
ipc.c
mem.c
net.c
process.c
resource.c
signal.c
strace.c
stream.c
syscall.c
time.c
util.c

diff --git a/defs.h b/defs.h
index 6cf378306c5ca3c472f3ef63ae2c9aa814e5f572..84b7d74fa944f8eacdc4d78df0bf92737e24e61a 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -48,7 +48,7 @@
 
 /* Configuration section */
 #ifndef MAX_QUALS
-#if defined(LINUX) && defined(MIPS)
+#if defined(MIPS)
 #define MAX_QUALS      7000    /* maximum number of syscalls, signals, etc. */
 #else
 #define MAX_QUALS      2048    /* maximum number of syscalls, signals, etc. */
  * Make sure that all entries in all syscallent.h files
  * have nargs <= MAX_ARGS!
  * linux/<ARCH>/syscallent.h: all have nargs <= 6.
- * freebsd/i386/syscallent.h: one syscall with nargs = 8
- * (sys_sendfile, looks legitimate)
- * and one with nargs = 7 (sys_mmap, maybe it should have 6?).
- * sunos4/syscallent.h: all are <= 6.
- * svr4/syscallent.h: all are MA (MAX_ARGS), it's unclear what the real max is.
  */
 #ifndef MAX_ARGS
 #   define MAX_ARGS    6
@@ -578,8 +573,7 @@ extern void tv_div(struct timeval *, struct timeval *, int);
 extern char *stpcpy(char *dst, const char *src);
 #endif
 
-#if !(defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(IA64) \
-       && !defined(SH))
+#if defined(SPARC) || defined(SPARC64) || defined(IA64) || defined(SH)
 extern long getrval2(struct tcb *);
 #endif
 
diff --git a/desc.c b/desc.c
index 2d5ac5d3cde769d7715483f97aa8d792af6b2a90..be327eb47e03b91ea897eefb969c091b745831c1 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -465,13 +465,13 @@ sys_dup3(struct tcb *tcp)
        return do_dup2(tcp, 2);
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4)
+#if defined(ALPHA)
 int
 sys_getdtablesize(struct tcb *tcp)
 {
        return 0;
 }
-#endif /* ALPHA || FREEBSD || SUNOS4 */
+#endif
 
 static int
 decode_select(struct tcb *tcp, long *args, enum bitness_t bitness)
diff --git a/file.c b/file.c
index a1d30b3fcf276a681e7395231e843d437fac5fc7..7e3e3fbd6b38a6e7b66b5ed2df8caa2b82079417 100644 (file)
--- a/file.c
+++ b/file.c
@@ -41,7 +41,7 @@ struct kernel_dirent {
        char            d_name[1];
 };
 
-#  ifdef LINUXSPARC
+#ifdef LINUXSPARC
 struct stat {
        unsigned short  st_dev;
        unsigned int    st_ino;
@@ -61,7 +61,7 @@ struct stat {
        int             st_blocks;
        unsigned int    __unused4[2];
 };
-#if defined(SPARC64)
+# if defined(SPARC64)
 struct stat_sparc64 {
        unsigned int    st_dev;
        unsigned long   st_ino;
@@ -78,81 +78,82 @@ struct stat_sparc64 {
        long            st_blocks;
        unsigned long   __unused4[2];
 };
-#endif /* SPARC64 */
-#    define stat kernel_stat
-#    include <asm/stat.h>
-#    undef stat
-#  else
-#    undef dev_t
-#    undef ino_t
-#    undef mode_t
-#    undef nlink_t
-#    undef uid_t
-#    undef gid_t
-#    undef off_t
-#    undef loff_t
-
-#    define dev_t __kernel_dev_t
-#    define ino_t __kernel_ino_t
-#    define mode_t __kernel_mode_t
-#    define nlink_t __kernel_nlink_t
-#    define uid_t __kernel_uid_t
-#    define gid_t __kernel_gid_t
-#    define off_t __kernel_off_t
-#    define loff_t __kernel_loff_t
-
-#    include <asm/stat.h>
-
-#    undef dev_t
-#    undef ino_t
-#    undef mode_t
-#    undef nlink_t
-#    undef uid_t
-#    undef gid_t
-#    undef off_t
-#    undef loff_t
-
-#    define dev_t dev_t
-#    define ino_t ino_t
-#    define mode_t mode_t
-#    define nlink_t nlink_t
-#    define uid_t uid_t
-#    define gid_t gid_t
-#    define off_t off_t
-#    define loff_t loff_t
-#  endif
-#  ifdef HPPA  /* asm-parisc/stat.h defines stat64 */
-#    undef stat64
-#  endif
-#  define stat libc_stat
-#  define stat64 libc_stat64
-#  include <sys/stat.h>
-#  undef stat
-#  undef stat64
-   /* These might be macros. */
-#  undef st_atime
-#  undef st_mtime
-#  undef st_ctime
-#  ifdef HPPA
-#    define stat64 hpux_stat64
-#  endif
+# endif /* SPARC64 */
+# define stat kernel_stat
+# include <asm/stat.h>
+# undef stat
+#else
+# undef dev_t
+# undef ino_t
+# undef mode_t
+# undef nlink_t
+# undef uid_t
+# undef gid_t
+# undef off_t
+# undef loff_t
+
+# define dev_t __kernel_dev_t
+# define ino_t __kernel_ino_t
+# define mode_t __kernel_mode_t
+# define nlink_t __kernel_nlink_t
+# define uid_t __kernel_uid_t
+# define gid_t __kernel_gid_t
+# define off_t __kernel_off_t
+# define loff_t __kernel_loff_t
+
+# include <asm/stat.h>
+
+# undef dev_t
+# undef ino_t
+# undef mode_t
+# undef nlink_t
+# undef uid_t
+# undef gid_t
+# undef off_t
+# undef loff_t
+
+# define dev_t dev_t
+# define ino_t ino_t
+# define mode_t mode_t
+# define nlink_t nlink_t
+# define uid_t uid_t
+# define gid_t gid_t
+# define off_t off_t
+# define loff_t loff_t
+#endif
+
+#ifdef HPPA    /* asm-parisc/stat.h defines stat64 */
+# undef stat64
+#endif
+#define stat libc_stat
+#define stat64 libc_stat64
+#include <sys/stat.h>
+#undef stat
+#undef stat64
+ /* These might be macros. */
+#undef st_atime
+#undef st_mtime
+#undef st_ctime
+#ifdef HPPA
+# define stat64 hpux_stat64
+#endif
 
 #include <fcntl.h>
 
 
 #ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
+# include <sys/vfs.h>
 #endif
 
 #ifdef HAVE_LINUX_XATTR_H
-#include <linux/xattr.h>
+# include <linux/xattr.h>
 #else
-#define XATTR_CREATE 1
-#define XATTR_REPLACE 2
+# define XATTR_CREATE 1
+# define XATTR_REPLACE 2
 #endif
 
 
-#if _LFS64_LARGEFILE && (defined(LINUX) || defined(SVR4))
+#if _LFS64_LARGEFILE
 # ifdef HAVE_INTTYPES_H
 #  include <inttypes.h>
 # else
@@ -166,27 +167,27 @@ struct stat_sparc64 {
  * Ugly hacks for systems that have typedef long long off_t
  */
 
-#define stat64 stat
-#define HAVE_STAT64 1  /* Ugly hack */
+# define stat64 stat
+# define HAVE_STAT64 1 /* Ugly hack */
 
-#define        sys_stat64      sys_stat
-#define sys_fstat64    sys_fstat
-#define sys_lstat64    sys_lstat
-#define sys_lseek64    sys_lseek
-#define sys_truncate64 sys_truncate
-#define sys_ftruncate64        sys_ftruncate
+# define sys_stat64    sys_stat
+# define sys_fstat64   sys_fstat
+# define sys_lstat64   sys_lstat
+# define sys_lseek64   sys_lseek
+# define sys_truncate64        sys_truncate
+# define sys_ftruncate64       sys_ftruncate
 #endif
 
 #ifdef MAJOR_IN_SYSMACROS
-#include <sys/sysmacros.h>
+# include <sys/sysmacros.h>
 #endif
 
 #ifdef MAJOR_IN_MKDEV
-#include <sys/mkdev.h>
+# include <sys/mkdev.h>
 #endif
 
 #ifdef HAVE_SYS_ASYNCH_H
-#include <sys/asynch.h>
+# include <sys/asynch.h>
 #endif
 
 
@@ -830,7 +831,7 @@ printstat_sparc64(struct tcb *tcp, long addr)
 #endif /* SPARC64 */
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
 struct stat_powerpc32 {
        unsigned int    st_dev;
        unsigned int    st_ino;
@@ -893,7 +894,7 @@ printstat_powerpc32(struct tcb *tcp, long addr)
        else
                tprints("...}");
 }
-#endif /* LINUX && POWERPC64 */
+#endif /* POWERPC64 */
 
 static const struct xlat fileflags[] = {
        { 0,            NULL            },
@@ -994,7 +995,7 @@ printstat(struct tcb *tcp, long addr)
 #endif
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
        if (current_personality == 1) {
                printstat_powerpc32(tcp, addr);
                return;
@@ -1010,7 +1011,7 @@ printstat(struct tcb *tcp, long addr)
 }
 #endif /* !HAVE_LONG_LONG_OFF_T */
 
-#if !defined HAVE_STAT64 && defined LINUX && defined X86_64
+#if !defined HAVE_STAT64 && defined X86_64
 /*
  * Linux x86_64 has unified `struct stat' but its i386 biarch needs
  * `struct stat64'.  Its <asm-i386/stat.h> definition expects 32-bit `long'.
@@ -1074,7 +1075,7 @@ printstat64(struct tcb *tcp, long addr)
 # endif
 #endif /* LINUXSPARC */
 
-#if defined LINUX && defined X86_64
+#if defined X86_64
        if (current_personality == 0) {
                printstat(tcp, addr);
                return;
@@ -1162,8 +1163,7 @@ printstat64(struct tcb *tcp, long addr)
 }
 #endif /* HAVE_STAT64 */
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 static void
 convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
 {
@@ -1198,12 +1198,12 @@ printoldstat(struct tcb *tcp, long addr)
                return;
        }
 
-#ifdef LINUXSPARC
+# ifdef LINUXSPARC
        if (current_personality == 1) {
                printstatsol(tcp, addr);
                return;
        }
-#endif /* LINUXSPARC */
+# endif
 
        if (umove(tcp, addr, &statbuf) < 0) {
                tprints("{...}");
@@ -1213,7 +1213,7 @@ printoldstat(struct tcb *tcp, long addr)
        convertoldstat(&statbuf, &newstatbuf);
        realprintstat(tcp, &newstatbuf);
 }
-#endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1278,8 +1278,7 @@ sys_newfstatat(struct tcb *tcp)
        return 0;
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldstat(struct tcb *tcp)
 {
@@ -1291,7 +1290,7 @@ sys_oldstat(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1323,8 +1322,7 @@ sys_fstat64(struct tcb *tcp)
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldfstat(struct tcb *tcp)
 {
@@ -1336,7 +1334,7 @@ sys_oldfstat(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 #ifndef HAVE_LONG_LONG_OFF_T
 int
@@ -1368,8 +1366,7 @@ sys_lstat64(struct tcb *tcp)
 #endif
 }
 
-#if defined(LINUX) && defined(HAVE_STRUCT___OLD_KERNEL_STAT) \
-    && !defined(HAVE_LONG_LONG_OFF_T)
+#if defined(HAVE_STRUCT___OLD_KERNEL_STAT) && !defined(HAVE_LONG_LONG_OFF_T)
 int
 sys_oldlstat(struct tcb *tcp)
 {
@@ -1381,10 +1378,10 @@ sys_oldlstat(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
 
 
-#if defined(SVR4) || defined(LINUXSPARC)
+#if defined(LINUXSPARC)
 
 int
 sys_xstat(struct tcb *tcp)
@@ -1394,11 +1391,11 @@ sys_xstat(struct tcb *tcp)
                printpath(tcp, tcp->u_arg[1]);
                tprints(", ");
        } else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
                if (tcp->u_arg[0] == _STAT64_VER)
                        printstat64 (tcp, tcp->u_arg[2]);
                else
-#endif
+# endif
                printstat(tcp, tcp->u_arg[2]);
        }
        return 0;
@@ -1410,11 +1407,11 @@ sys_fxstat(struct tcb *tcp)
        if (entering(tcp))
                tprintf("%ld, %ld, ", tcp->u_arg[0], tcp->u_arg[1]);
        else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
                if (tcp->u_arg[0] == _STAT64_VER)
                        printstat64 (tcp, tcp->u_arg[2]);
                else
-#endif
+# endif
                printstat(tcp, tcp->u_arg[2]);
        }
        return 0;
@@ -1428,11 +1425,11 @@ sys_lxstat(struct tcb *tcp)
                printpath(tcp, tcp->u_arg[1]);
                tprints(", ");
        } else {
-#ifdef _STAT64_VER
+# ifdef _STAT64_VER
                if (tcp->u_arg[0] == _STAT64_VER)
                        printstat64 (tcp, tcp->u_arg[2]);
                else
-#endif
+# endif
                printstat(tcp, tcp->u_arg[2]);
        }
        return 0;
@@ -1449,15 +1446,9 @@ sys_xmknod(struct tcb *tcp)
                tprintf(", %s", sprintmode(mode));
                switch (mode & S_IFMT) {
                case S_IFCHR: case S_IFBLK:
-#ifdef LINUXSPARC
                        tprintf(", makedev(%lu, %lu)",
                                (unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
                                (unsigned long) (tcp->u_arg[3] & 0x3ffff));
-#else
-                       tprintf(", makedev(%lu, %lu)",
-                               (unsigned long) major(tcp->u_arg[3]),
-                               (unsigned long) minor(tcp->u_arg[3]));
-#endif
                        break;
                default:
                        break;
@@ -1466,29 +1457,29 @@ sys_xmknod(struct tcb *tcp)
        return 0;
 }
 
-#ifdef HAVE_SYS_ACL_H
+# ifdef HAVE_SYS_ACL_H
 
-#include <sys/acl.h>
+#  include <sys/acl.h>
 
 static const struct xlat aclcmds[] = {
-#ifdef SETACL
+#  ifdef SETACL
        { SETACL,       "SETACL"        },
-#endif
-#ifdef GETACL
+#  endif
+#  ifdef GETACL
        { GETACL,       "GETACL"        },
-#endif
-#ifdef GETACLCNT
+#  endif
+#  ifdef GETACLCNT
        { GETACLCNT,    "GETACLCNT"     },
-#endif
-#ifdef ACL_GET
+#  endif
+#  ifdef ACL_GET
        { ACL_GET,      "ACL_GET"       },
-#endif
-#ifdef ACL_SET
+#  endif
+#  ifdef ACL_SET
        { ACL_SET,      "ACL_SET"       },
-#endif
-#ifdef ACL_CNT
+#  endif
+#  ifdef ACL_CNT
        { ACL_CNT,      "ACL_CNT"       },
-#endif
+#  endif
        { 0,            NULL            },
 };
 
@@ -1534,15 +1525,15 @@ sys_facl(struct tcb *tcp)
 
 
 static const struct xlat aclipc[] = {
-#ifdef IPC_SHM
+#  ifdef IPC_SHM
        { IPC_SHM,      "IPC_SHM"       },
-#endif
-#ifdef IPC_SEM
+#  endif
+#  ifdef IPC_SEM
        { IPC_SEM,      "IPC_SEM"       },
-#endif
-#ifdef IPC_MSG
+#  endif
+#  ifdef IPC_MSG
        { IPC_MSG,      "IPC_MSG"       },
-#endif
+#  endif
        { 0,            NULL            },
 };
 
@@ -1567,9 +1558,9 @@ sys_aclipc(struct tcb *tcp)
        return 0;
 }
 
-#endif /* HAVE_SYS_ACL_H */
+# endif /* HAVE_SYS_ACL_H */
 
-#endif /* SVR4 || LINUXSPARC */
+#endif /* LINUXSPARC */
 
 
 static const struct xlat fsmagic[] = {
@@ -1687,7 +1678,7 @@ sys_fstatfs(struct tcb *tcp)
        return 0;
 }
 
-#if defined LINUX && defined HAVE_STATFS64
+#if defined HAVE_STATFS64
 static void
 printstatfs64(struct tcb *tcp, long addr)
 {
@@ -1804,8 +1795,7 @@ sys_fstatfs64(struct tcb *tcp)
 }
 #endif
 
-#if defined(LINUX) && defined(__alpha)
-
+#if defined(__alpha)
 int
 osf_statfs(struct tcb *tcp)
 {
@@ -1830,8 +1820,7 @@ osf_fstatfs(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* LINUX && __alpha */
-
+#endif
 
 
 /* directory */
diff --git a/io.c b/io.c
index 9aa0ddd0683ecd810805d05b3fcdb7bf61eeab81..7dff4e63b1a2a8239b519ded522b57025e3618f2 100644 (file)
--- a/io.c
+++ b/io.c
@@ -69,7 +69,7 @@ sys_write(struct tcb *tcp)
 void
 tprint_iov(struct tcb *tcp, unsigned long len, unsigned long addr, int decode_iov)
 {
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
        union {
                struct { u_int32_t base; u_int32_t len; } iov32;
                struct { u_int64_t base; u_int64_t len; } iov64;
diff --git a/ipc.c b/ipc.c
index 963537e2453f69c5bab1ac0533af75526fe73ac2..d8757c1f1d6fd1c1fb62e011ec3ef685fb62a3ad 100644 (file)
--- a/ipc.c
+++ b/ipc.c
@@ -62,7 +62,7 @@
 #define SEM_INFO 19
 #endif
 
-#if defined LINUX && !defined IPC_64
+#if !defined IPC_64
 # define IPC_64 0x100
 #endif
 
@@ -421,11 +421,11 @@ int sys_shmat(struct tcb *tcp)
                if (syserror(tcp))
                        return 0;
 /* HPPA does not use an IPC multiplexer on Linux.  */
-#if defined(LINUX) && !defined(HPPA)
+#if !defined(HPPA)
                if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
                        return RVAL_NONE;
                tcp->u_rval = raddr;
-#endif /* LINUX */
+#endif
                return RVAL_HEX;
        }
        return 0;
diff --git a/mem.c b/mem.c
index e8bad07dfd1b957a7c996178c1b00c1116d185a1..252486ad70fd4f908e45f8d6e4406aaaab75a559 100644 (file)
--- a/mem.c
+++ b/mem.c
 #include <asm/mman.h>
 #include <sys/mman.h>
 
-#if defined(LINUX) && defined(I386)
+#if defined(I386)
 # include <asm/ldt.h>
 # ifdef HAVE_STRUCT_USER_DESC
 #  define modify_ldt_ldt_s user_desc
 # endif
 #endif
-#if defined(LINUX) && defined(SH64)
+#if defined(SH64)
 # include <asm/page.h>     /* for PAGE_SHIFT */
 #endif
 
@@ -299,7 +299,7 @@ sys_mmap(struct tcb *tcp)
         * from pages to bytes. See test/mmap_offset_decode.c
         * Why SH64 and i386 are handled differently?
         */
-#if defined(LINUX) && defined(SH64)
+#if defined(SH64)
        /*
         * Old mmap differs from new mmap in specifying the
         * offset in units of bytes rather than pages.  We
@@ -325,7 +325,7 @@ int
 sys_mmap64(struct tcb *tcp)
 {
        if (entering(tcp)) {
-#if !defined(LINUX) || defined(ALPHA)
+#if defined(ALPHA)
                long *u_arg = tcp->u_arg;
 #else
                long u_arg[7];
@@ -354,7 +354,7 @@ sys_mmap64(struct tcb *tcp)
                tprints(", ");
                printfd(tcp, u_arg[4]);
                /* offset */
-#if !defined(LINUX) || defined(ALPHA)
+#if defined(ALPHA)
                printllval(tcp, ", %#llx", 5);
 #else
                /* NOTE: not verified that [5] and [6] should be used.
@@ -574,7 +574,7 @@ sys_mincore(struct tcb *tcp)
        return 0;
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(IA64) || defined(SUNOS4) || defined(SVR4) || defined(SPARC) || defined(SPARC64)
+#if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64)
 int
 sys_getpagesize(struct tcb *tcp)
 {
@@ -582,9 +582,9 @@ sys_getpagesize(struct tcb *tcp)
                return RVAL_HEX;
        return 0;
 }
-#endif /* ALPHA || FREEBSD || IA64 || SUNOS4 || SVR4 */
+#endif
 
-#if defined(LINUX) && defined(__i386__)
+#if defined(__i386__)
 void
 print_ldt_entry(struct modify_ldt_ldt_s *ldt_entry)
 {
@@ -676,10 +676,9 @@ sys_get_thread_area(struct tcb *tcp)
        return 0;
 
 }
-#endif /* LINUX && __i386__ */
-
-#if defined(LINUX) && defined(M68K)
+#endif /* __i386__ */
 
+#if defined(M68K)
 int
 sys_set_thread_area(struct tcb *tcp)
 {
@@ -910,7 +909,7 @@ sys_move_pages(struct tcb *tcp)
        return 0;
 }
 
-#if defined(LINUX) && defined(POWERPC)
+#if defined(POWERPC)
 int
 sys_subpage_prot(struct tcb *tcp)
 {
diff --git a/net.c b/net.c
index e7d2a07f8b56042d9656b55157955126fab914c3..3955f1688fb7952430f33bc492f5f26e6f5a0bf5 100644 (file)
--- a/net.c
+++ b/net.c
@@ -1218,7 +1218,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
 #ifdef HAVE_INET_NTOP
                struct sockaddr_in6 sa6;
 #endif
-#if defined(LINUX) && defined(AF_IPX)
+#if defined(AF_IPX)
                struct sockaddr_ipx sipx;
 #endif
 #ifdef AF_PACKET
@@ -1297,7 +1297,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
 #endif
                break;
 #endif
-#if defined(AF_IPX) && defined(linux)
+#if defined(AF_IPX)
        case AF_IPX:
                {
                        int i;
@@ -1315,7 +1315,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
                        tprintf("/[%02x]", addrbuf.sipx.sipx_type);
                }
                break;
-#endif /* AF_IPX && linux */
+#endif /* AF_IPX */
 #ifdef AF_PACKET
        case AF_PACKET:
                {
@@ -1332,7 +1332,7 @@ printsock(struct tcb *tcp, long addr, int addrlen)
                }
                break;
 
-#endif /* AF_APACKET */
+#endif /* AF_PACKET */
 #ifdef AF_NETLINK
        case AF_NETLINK:
                tprintf("pid=%d, groups=%08x", addrbuf.nl.nl_pid, addrbuf.nl.nl_groups);
@@ -1800,14 +1800,14 @@ do_pipe(struct tcb *tcp, int flags_arg)
                if (syserror(tcp)) {
                        tprintf("%#lx", tcp->u_arg[0]);
                } else {
-#if defined(LINUX) && !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
+#if !defined(SPARC) && !defined(SPARC64) && !defined(SH) && !defined(IA64)
                        int fds[2];
 
                        if (umoven(tcp, tcp->u_arg[0], sizeof fds, (char *) fds) < 0)
                                tprints("[...]");
                        else
                                tprintf("[%u, %u]", fds[0], fds[1]);
-#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(SVR4) || defined(FREEBSD) || defined(IA64)
+#elif defined(SPARC) || defined(SPARC64) || defined(SH) || defined(IA64)
                        tprintf("[%lu, %lu]", tcp->u_rval, getrval2(tcp));
 #else
                        tprintf("%#lx", tcp->u_arg[0]);
index 699355bfe7f8505b39e5eb3c960a2ba371bebfb6..20cfe206b0847ad96c040d073cae5c24611a29f4 100644 (file)
--- a/process.c
+++ b/process.c
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
-#ifndef PTRACE_PEEKUSR
-# define PTRACE_PEEKUSR PTRACE_PEEKUSER
-#endif
-#ifndef PTRACE_POKEUSR
-# define PTRACE_POKEUSR PTRACE_POKEUSER
-#endif
+# ifndef PTRACE_PEEKUSR
+#  define PTRACE_PEEKUSR PTRACE_PEEKUSER
+# endif
+# ifndef PTRACE_POKEUSR
+#  define PTRACE_POKEUSR PTRACE_POKEUSER
+# endif
 #endif
 
 #ifdef HAVE_LINUX_PTRACE_H
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # define r_pc r_tpc
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
 #ifdef HAVE_LINUX_FUTEX_H
 # include <linux/futex.h>
 #endif
-# ifndef FUTEX_WAIT
-#  define FUTEX_WAIT 0
-# endif
-# ifndef FUTEX_WAKE
-#  define FUTEX_WAKE 1
-# endif
-# ifndef FUTEX_FD
-#  define FUTEX_FD 2
-# endif
-# ifndef FUTEX_REQUEUE
-#  define FUTEX_REQUEUE 3
-# endif
+#ifndef FUTEX_WAIT
+# define FUTEX_WAIT 0
+#endif
+#ifndef FUTEX_WAKE
+# define FUTEX_WAKE 1
+#endif
+#ifndef FUTEX_FD
+# define FUTEX_FD 2
+#endif
+#ifndef FUTEX_REQUEUE
+# define FUTEX_REQUEUE 3
+#endif
 
 #include <sched.h>
 #include <asm/posix_types.h>
 #undef GETGROUPS32_T
 #define GETGROUPS32_T __kernel_gid32_t
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
@@ -360,7 +360,7 @@ sys_sethostname(struct tcb *tcp)
        return 0;
 }
 
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
 int
 sys_gethostname(struct tcb *tcp)
 {
@@ -373,7 +373,7 @@ sys_gethostname(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* ALPHA || FREEBSD || SUNOS4 || SVR4 */
+#endif
 
 int
 sys_setdomainname(struct tcb *tcp)
@@ -1068,7 +1068,7 @@ sys_getgroups32(struct tcb *tcp)
        return 0;
 }
 
-#if defined(ALPHA) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
 int
 sys_setpgrp(struct tcb *tcp)
 {
@@ -1077,7 +1077,7 @@ sys_setpgrp(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* ALPHA || SUNOS4 || SVR4 */
+#endif
 
 int
 sys_getpgrp(struct tcb *tcp)
@@ -1165,7 +1165,7 @@ printargc(const char *fmt, struct tcb *tcp, long addr)
        tprintf(fmt, count, count == 1 ? "" : "s");
 }
 
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+#if defined(SPARC) || defined(SPARC64)
 int
 sys_execv(struct tcb *tcp)
 {
@@ -1181,7 +1181,7 @@ sys_execv(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* SPARC || SPARC64 || SUNOS4 */
+#endif
 
 int
 sys_execve(struct tcb *tcp)
@@ -1209,11 +1209,10 @@ sys_execve(struct tcb *tcp)
 }
 
 
-#if defined SUNOS4 || (defined LINUX && defined TCB_WAITEXECVE)
+#if defined(TCB_WAITEXECVE)
 int
 internal_exec(struct tcb *tcp)
 {
-# if defined LINUX && defined TCB_WAITEXECVE
        if (exiting(tcp) && syserror(tcp))
                tcp->flags &= ~TCB_WAITEXECVE;
        else {
@@ -1221,7 +1220,6 @@ internal_exec(struct tcb *tcp)
                if (!(ptrace_setoptions & PTRACE_O_TRACEEXEC))
                        tcp->flags |= TCB_WAITEXECVE; /* no */
        }
-# endif
        return 0;
 }
 #endif
index b340ccd116785fd7ad37fb2184f6394c3f4812f2..9040b0520e3aca59c410ec38345f950494b914a9 100644 (file)
@@ -118,7 +118,7 @@ sprintrlim(long lim)
        return buf;
 }
 
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
 static void
 print_rlimit32(struct tcb *tcp)
 {
@@ -152,7 +152,7 @@ sys_getrlimit(struct tcb *tcp)
        else {
                if (syserror(tcp) || !verbose(tcp))
                        tprintf("%#lx", tcp->u_arg[1]);
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
                else if (current_personality == 1)
                        print_rlimit32(tcp);
 # endif
@@ -176,7 +176,7 @@ sys_setrlimit(struct tcb *tcp)
                tprints(", ");
                if (!verbose(tcp))
                        tprintf("%#lx", tcp->u_arg[1]);
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
                else if (current_personality == 1)
                        print_rlimit32(tcp);
 # endif
index f9e826c86dc083d65cae64b8b690133ae6f1e458..eab5c52288f3fb18d51811b914b78d381821e732 100644 (file)
--- a/signal.c
+++ b/signal.c
 
 #ifdef HAVE_SYS_REG_H
 # include <sys/reg.h>
-#ifndef PTRACE_PEEKUSR
-# define PTRACE_PEEKUSR PTRACE_PEEKUSER
-#endif
-#ifndef PTRACE_POKEUSR
-# define PTRACE_POKEUSR PTRACE_POKEUSER
-#endif
+# ifndef PTRACE_PEEKUSR
+#  define PTRACE_PEEKUSR PTRACE_PEEKUSER
+# endif
+# ifndef PTRACE_POKEUSR
+#  define PTRACE_POKEUSR PTRACE_POKEUSER
+# endif
 #elif defined(HAVE_LINUX_PTRACE_H)
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
 # include <asm/ptrace_offsets.h>
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
-#if defined (SPARC) || defined (SPARC64) || defined (MIPS)
+#if defined(SPARC) || defined(SPARC64) || defined(MIPS)
 typedef struct {
        struct pt_regs          si_regs;
        int                     si_mask;
 } m_siginfo_t;
 #elif defined HAVE_ASM_SIGCONTEXT_H
-#if !defined(IA64) && !defined(X86_64)
-#include <asm/sigcontext.h>
-#endif /* !IA64 && !X86_64 */
+# if !defined(IA64) && !defined(X86_64)
+#  include <asm/sigcontext.h>
+# endif /* !IA64 && !X86_64 */
 #else /* !HAVE_ASM_SIGCONTEXT_H */
-#if defined I386 && !defined HAVE_STRUCT_SIGCONTEXT_STRUCT
+# if defined I386 && !defined HAVE_STRUCT_SIGCONTEXT_STRUCT
 struct sigcontext_struct {
        unsigned short gs, __gsh;
        unsigned short fs, __fsh;
@@ -110,8 +110,8 @@ struct sigcontext_struct {
        unsigned long oldmask;
        unsigned long cr2;
 };
-#else /* !I386 */
-#if defined M68K && !defined HAVE_STRUCT_SIGCONTEXT
+# else /* !I386 */
+#  if defined M68K && !defined HAVE_STRUCT_SIGCONTEXT
 struct sigcontext
 {
        unsigned long sc_mask;
@@ -124,25 +124,25 @@ struct sigcontext
        unsigned long sc_pc;
        unsigned short sc_formatvec;
 };
-#endif /* M68K */
-#endif /* !I386 */
+#  endif /* M68K */
+# endif /* !I386 */
 #endif /* !HAVE_ASM_SIGCONTEXT_H */
 
 #ifndef NSIG
-#warning: NSIG is not defined, using 32
-#define NSIG 32
+# warning: NSIG is not defined, using 32
+# define NSIG 32
 #endif
 #ifdef ARM
 /* Ugh. Is this really correct? ARM has no RT signals?! */
-#undef NSIG
-#define NSIG 32
+# undef NSIG
+# define NSIG 32
 #endif
 
 
 
 #ifdef HAVE_SIGACTION
 
-#if defined LINUX && (defined I386 || defined X86_64)
+#if defined I386 || defined X86_64
 /* The libc headers do not define this constant since it should only be
    used by the implementation.  So we define it here.  */
 # ifndef SA_RESTORER
@@ -427,7 +427,7 @@ print_sigset(struct tcb *tcp, long addr, int rt)
 
 #define SI_FROMUSER(sip)       ((sip)->si_code <= 0)
 
-#endif /* LINUX */
+#endif
 
 #if __GLIBC_MINOR__ < 1
 /* Type for data associated with a signal.  */
@@ -1141,7 +1141,7 @@ sys_sigsuspend(struct tcb *tcp)
 
 
 
-#if defined LINUX && !defined SS_ONSTACK
+#if !defined SS_ONSTACK
 #define SS_ONSTACK      1
 #define SS_DISABLE      2
 #if __GLIBC_MINOR__ == 0
index bda091eda3e5f97fcd2bb90b784c0635fcc51117..66dee5f817687f39c1d3db7312fead67c560b930 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -58,7 +58,7 @@
 #  define my_tkill(tid, sig) kill((tid), (sig))
 # endif
 
-#if defined(IA64) && defined(LINUX)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 #endif
 
index a5bd831888dc9e50e623963cf12d86267795e7fc..3eb7dde5a7f1bca847aa91bf653b5af27e453f74 100644 (file)
--- a/stream.c
+++ b/stream.c
@@ -120,7 +120,7 @@ sys_putmsg(struct tcb *tcp)
        return 0;
 }
 
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4) || defined(SVR4)
+#if defined(SPARC) || defined(SPARC64)
 int
 sys_getmsg(struct tcb *tcp)
 {
@@ -166,7 +166,7 @@ sys_getmsg(struct tcb *tcp)
        }
        return RVAL_HEX | RVAL_STR;
 }
-#endif /* SPARC || SPARC64 || SUNOS4 || SVR4 */
+#endif
 
 #if defined SYS_putpmsg || defined SYS_getpmsg
 static const struct xlat pmsgflags[] = {
index 978c65a4bb10637f7253c315ccbf74e1ad7ca177..b94ad6516cf7bb9ff57d9f42c047337fa20762ab 100644 (file)
--- a/syscall.c
+++ b/syscall.c
 # undef pt_all_user_regs
 #endif
 
-#if defined (LINUX) && defined (SPARC64)
+#if defined(SPARC64)
 # undef PTRACE_GETREGS
 # define PTRACE_GETREGS PTRACE_GETREGS64
 # undef PTRACE_SETREGS
 # define PTRACE_SETREGS PTRACE_SETREGS64
-#endif /* LINUX && SPARC64 */
+#endif
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
@@ -523,7 +523,7 @@ qualify(const char *s)
 
 enum subcall_style { shift_style, deref_style, mask_style, door_style };
 
-#if !(defined(LINUX) && ( defined(ALPHA) || defined(MIPS) || defined(__ARM_EABI__) ))
+#if !(defined(ALPHA) || defined(MIPS) || defined(__ARM_EABI__))
 
 static void
 decode_subcall(struct tcb *tcp, int subcall, int nsubcalls, enum subcall_style style)
@@ -1206,9 +1206,9 @@ internal_syscall(struct tcb *tcp)
           )
                return internal_fork(tcp);
 
-#if defined SUNOS4 || (defined LINUX && defined TCB_WAITEXECVE)
+#if defined(TCB_WAITEXECVE)
        if (   sys_execve == func
-# if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+# if defined(SPARC) || defined(SPARC64)
            || sys_execv == func
 # endif
           )
diff --git a/time.c b/time.c
index 86f102e07cb0af02ab80b14e7b7c115d34d2bc99..4cc9c5910ebfe7fd2517dd7f620e969d92fd27ef 100644 (file)
--- a/time.c
+++ b/time.c
@@ -81,7 +81,7 @@ sprinttv(char *buf, struct tcb *tcp, long addr, enum bitness_t bitness, int spec
                return buf + sprintf(buf, "%#lx", addr);
 
        if (bitness == BITNESS_32
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
            || personality_wordsize[current_personality] == 4
 #endif
                )
@@ -137,7 +137,7 @@ sprint_timespec(char *buf, struct tcb *tcp, long addr)
        else {
                int rc;
 
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
                if (personality_wordsize[current_personality] == 4) {
                        struct timeval32 tv;
 
@@ -291,7 +291,7 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
                int rc;
 
                if (bitness == BITNESS_32
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
                    || personality_wordsize[current_personality] == 4
 #endif
                        )
diff --git a/util.c b/util.c
index b7ba283b9947d2ede571fc6af1a8357a56d7bc9c..80acc133f818f49cae247b5e283115b35250602f 100644 (file)
--- a/util.c
+++ b/util.c
 #include <sys/uio.h>
 #endif
 
-#if defined(linux) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1))
+#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
 #include <linux/ptrace.h>
 #endif
 
-#if defined(LINUX) && defined(IA64)
+#if defined(IA64)
 # include <asm/ptrace_offsets.h>
 # include <asm/rse.h>
 #endif
 
 #ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
+# include <sys/reg.h>
 # define PTRACE_PEEKUSR PTRACE_PEEKUSER
 #elif defined(HAVE_LINUX_PTRACE_H)
-#undef PTRACE_SYSCALL
+# undef PTRACE_SYSCALL
 # ifdef HAVE_STRUCT_IA64_FPREG
 #  define ia64_fpreg XXX_ia64_fpreg
 # endif
 # ifdef HAVE_STRUCT_PT_ALL_USER_REGS
 #  define pt_all_user_regs XXX_pt_all_user_regs
 # endif
-#include <linux/ptrace.h>
+# include <linux/ptrace.h>
 # undef ia64_fpreg
 # undef pt_all_user_regs
 #endif
@@ -246,7 +246,7 @@ printxval(const struct xlat *xlat, int val, const char *dflt)
 int
 printllval(struct tcb *tcp, const char *format, int llarg)
 {
-# if defined LINUX && (defined X86_64 || defined POWERPC64)
+# if defined X86_64 || defined POWERPC64
        if (current_personality == 0) {
                tprintf(format, tcp->u_arg[llarg]);
                llarg++;
@@ -655,7 +655,7 @@ printstr(struct tcb *tcp, long addr, int len)
 void
 dumpiov(struct tcb *tcp, int len, long addr)
 {
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
        union {
                struct { u_int32_t base; u_int32_t len; } *iov32;
                struct { u_int64_t base; u_int64_t len; } *iov64;