/* 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
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
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)
char d_name[1];
};
-# ifdef LINUXSPARC
+#ifdef LINUXSPARC
struct stat {
unsigned short st_dev;
unsigned int st_ino;
int st_blocks;
unsigned int __unused4[2];
};
-#if defined(SPARC64)
+# if defined(SPARC64)
struct stat_sparc64 {
unsigned int st_dev;
unsigned long st_ino;
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
* 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
#endif /* SPARC64 */
#endif /* LINUXSPARC */
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
struct stat_powerpc32 {
unsigned int st_dev;
unsigned int st_ino;
else
tprints("...}");
}
-#endif /* LINUX && POWERPC64 */
+#endif /* POWERPC64 */
static const struct xlat fileflags[] = {
{ 0, NULL },
#endif
#endif /* LINUXSPARC */
-#if defined LINUX && defined POWERPC64
+#if defined POWERPC64
if (current_personality == 1) {
printstat_powerpc32(tcp, addr);
return;
}
#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'.
# endif
#endif /* LINUXSPARC */
-#if defined LINUX && defined X86_64
+#if defined X86_64
if (current_personality == 0) {
printstat(tcp, addr);
return;
}
#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)
{
return;
}
-#ifdef LINUXSPARC
+# ifdef LINUXSPARC
if (current_personality == 1) {
printstatsol(tcp, addr);
return;
}
-#endif /* LINUXSPARC */
+# endif
if (umove(tcp, addr, &statbuf) < 0) {
tprints("{...}");
convertoldstat(&statbuf, &newstatbuf);
realprintstat(tcp, &newstatbuf);
}
-#endif /* LINUX && !IA64 && !HPPA && !X86_64 && !S390 && !S390X */
+#endif
#ifndef HAVE_LONG_LONG_OFF_T
int
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)
{
}
return 0;
}
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
#ifndef HAVE_LONG_LONG_OFF_T
int
#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)
{
}
return 0;
}
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
#ifndef HAVE_LONG_LONG_OFF_T
int
#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)
{
}
return 0;
}
-#endif /* LINUX && HAVE_STRUCT___OLD_KERNEL_STAT */
+#endif
-#if defined(SVR4) || defined(LINUXSPARC)
+#if defined(LINUXSPARC)
int
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;
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;
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;
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;
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 },
};
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 },
};
return 0;
}
-#endif /* HAVE_SYS_ACL_H */
+# endif /* HAVE_SYS_ACL_H */
-#endif /* SVR4 || LINUXSPARC */
+#endif /* LINUXSPARC */
static const struct xlat fsmagic[] = {
return 0;
}
-#if defined LINUX && defined HAVE_STATFS64
+#if defined HAVE_STATFS64
static void
printstatfs64(struct tcb *tcp, long addr)
{
}
#endif
-#if defined(LINUX) && defined(__alpha)
-
+#if defined(__alpha)
int
osf_statfs(struct tcb *tcp)
{
}
return 0;
}
-#endif /* LINUX && __alpha */
-
+#endif
/* directory */
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;
#define SEM_INFO 19
#endif
-#if defined LINUX && !defined IPC_64
+#if !defined IPC_64
# define IPC_64 0x100
#endif
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;
#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
* 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
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];
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.
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)
{
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)
{
return 0;
}
-#endif /* LINUX && __i386__ */
-
-#if defined(LINUX) && defined(M68K)
+#endif /* __i386__ */
+#if defined(M68K)
int
sys_set_thread_area(struct tcb *tcp)
{
return 0;
}
-#if defined(LINUX) && defined(POWERPC)
+#if defined(POWERPC)
int
sys_subpage_prot(struct tcb *tcp)
{
#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
#endif
break;
#endif
-#if defined(AF_IPX) && defined(linux)
+#if defined(AF_IPX)
case AF_IPX:
{
int i;
tprintf("/[%02x]", addrbuf.sipx.sipx_type);
}
break;
-#endif /* AF_IPX && linux */
+#endif /* AF_IPX */
#ifdef AF_PACKET
case AF_PACKET:
{
}
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);
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]);
#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
return 0;
}
-#if defined(ALPHA) || defined(FREEBSD) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
int
sys_gethostname(struct tcb *tcp)
{
}
return 0;
}
-#endif /* ALPHA || FREEBSD || SUNOS4 || SVR4 */
+#endif
int
sys_setdomainname(struct tcb *tcp)
return 0;
}
-#if defined(ALPHA) || defined(SUNOS4) || defined(SVR4)
+#if defined(ALPHA)
int
sys_setpgrp(struct tcb *tcp)
{
}
return 0;
}
-#endif /* ALPHA || SUNOS4 || SVR4 */
+#endif
int
sys_getpgrp(struct tcb *tcp)
tprintf(fmt, count, count == 1 ? "" : "s");
}
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4)
+#if defined(SPARC) || defined(SPARC64)
int
sys_execv(struct tcb *tcp)
{
}
return 0;
}
-#endif /* SPARC || SPARC64 || SUNOS4 */
+#endif
int
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 {
if (!(ptrace_setoptions & PTRACE_O_TRACEEXEC))
tcp->flags |= TCB_WAITEXECVE; /* no */
}
-# endif
return 0;
}
#endif
return buf;
}
-# if defined LINUX && (defined POWERPC64 || defined X86_64)
+# if defined POWERPC64 || defined X86_64
static void
print_rlimit32(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
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
#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;
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;
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
#define SI_FROMUSER(sip) ((sip)->si_code <= 0)
-#endif /* LINUX */
+#endif
#if __GLIBC_MINOR__ < 1
/* Type for data associated with a signal. */
-#if defined LINUX && !defined SS_ONSTACK
+#if !defined SS_ONSTACK
#define SS_ONSTACK 1
#define SS_DISABLE 2
#if __GLIBC_MINOR__ == 0
# define my_tkill(tid, sig) kill((tid), (sig))
# endif
-#if defined(IA64) && defined(LINUX)
+#if defined(IA64)
# include <asm/ptrace_offsets.h>
#endif
return 0;
}
-#if defined(SPARC) || defined(SPARC64) || defined(SUNOS4) || defined(SVR4)
+#if defined(SPARC) || defined(SPARC64)
int
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[] = {
# 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
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)
)
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
)
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
)
else {
int rc;
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
if (personality_wordsize[current_personality] == 4) {
struct timeval32 tv;
int rc;
if (bitness == BITNESS_32
-#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
+#if SUPPORTED_PERSONALITIES > 1
|| personality_wordsize[current_personality] == 4
#endif
)
#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
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++;
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;