]> granicus.if.org Git - strace/commitdiff
Remove initialization of native_scno field
authorDmitry V. Levin <ldv@altlinux.org>
Mon, 20 Feb 2012 21:17:58 +0000 (21:17 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 20 Feb 2012 21:17:58 +0000 (21:17 +0000)
* linux/i386/syscallent.h: Remove native_scno initialization for clone,
fork and vfork.
* linux/ia64/syscallent.h (sys_fork, sys_vfork): Remove redirections
to printargs.
* linux/syscall.h [IA64]: Do not define SYS_fork and SYS_vfork.
* util.c (printcall) [IA64]: Likewise.
(setbpt): Use sys_func to check for clone, fork and vfork syscalls.

linux/i386/syscallent.h
linux/ia64/syscallent.h
linux/syscall.h
util.c

index 46d61f9bd50bc8126581fa3a7192bd85d4415033..83a901c4b636288965dbc82c5937c900f38e4714 100644 (file)
@@ -30,7 +30,7 @@
 
        { 0,    0,      sys_restart_syscall,    "restart_syscall" }, /* 0 */
        { 1,    TP,     sys_exit,               "_exit",        }, /* 1 */
-       { 0,    TP,     sys_fork,               "fork", SYS_fork }, /* 2 */
+       { 0,    TP,     sys_fork,               "fork",         }, /* 2 */
        { 3,    TD,     sys_read,               "read",         }, /* 3 */
        { 3,    TD,     sys_write,              "write",        }, /* 4 */
        { 3,    TD|TF,  sys_open,               "open"          }, /* 5 */
        { 6,    TI,     sys_ipc,                "ipc",          }, /* 117 */
        { 1,    TD,     sys_fsync,              "fsync"         }, /* 118 */
        { 0,    TS,     sys_sigreturn,          "sigreturn"     }, /* 119 */
-       { 5,    TP,     sys_clone,              "clone", SYS_clone }, /* 120 */
+       { 5,    TP,     sys_clone,              "clone"         }, /* 120 */
        { 2,    0,      sys_setdomainname,      "setdomainname" }, /* 121 */
        { 1,    0,      sys_uname,              "uname"         }, /* 122 */
        { 3,    0,      sys_modify_ldt,         "modify_ldt"    }, /* 123 */
        { 4,    TD|TN,  sys_sendfile,           "sendfile"      }, /* 187 */
        { 5,    0,      sys_getpmsg,            "getpmsg"       }, /* 188 */
        { 5,    0,      sys_putpmsg,            "putpmsg"       }, /* 189 */
-       { 0,    TP,     sys_vfork,              "vfork", SYS_vfork }, /* 190 */
+       { 0,    TP,     sys_vfork,              "vfork"         }, /* 190 */
        { 2,    0,      sys_getrlimit,          "getrlimit"     }, /* 191 */
        { 6,    TD,     sys_mmap,               "mmap2"         }, /* 192 */
        { 3,    TF,     sys_truncate64,         "truncate64"    }, /* 193 */
index 25f740293aacb529599205e00a25466ed84a0ab1..e3beb7907d295582617945e2d1b7cc30c119dc3e 100644 (file)
@@ -37,7 +37,6 @@
 #define sys_getpmsg            printargs
 #define sys_putpmsg            printargs
 #define sys_ugetrlimit         printargs
-#define sys_fork               printargs
 #define sys_waitpid            printargs
 #define sys_time               printargs
 #define sys_break              printargs
 #define sys_pwrite             printargs
 #define sys_sigaltstack                printargs
 #define sys_sendfile           printargs
-#define sys_vfork              printargs
 #define sys_truncate64         printargs
 #define sys_ftruncate64                printargs
 #define sys_stat64             printargs
 #undef sys_getpmsg
 #undef sys_putpmsg
 #undef sys_ugetrlimit
-#undef sys_fork
 #undef sys_waitpid
 #undef sys_time
 #undef sys_break
 #undef sys_pwrite
 #undef sys_sigaltstack
 #undef sys_sendfile
-#undef sys_vfork
 #undef sys_truncate64
 #undef sys_ftruncate64
 #undef sys_stat64
index de33c106b4073401c6538739b3d4d02529c58f4a..23c67c7e0c063fe97c0fade158d724a424585d78 100644 (file)
@@ -332,16 +332,6 @@ int sys_osf_wait4();
 #define SYS_ipc_nsubcalls      25
 #endif /* !(ALPHA || MIPS || HPPA) */
 
-#ifdef IA64
-  /*
-   * IA64 syscall numbers (the only ones available from standard header
-   * files) are disjoint from IA32 syscall numbers.  We need to define
-   * some IA32 specific syscalls here.
-   */
-# define SYS_fork      2
-# define SYS_vfork     190
-#endif /* IA64 */
-
 #if defined(ALPHA) || defined(IA64) || defined(SPARC) || defined(SPARC64)
 int sys_getpagesize();
 #endif
diff --git a/util.c b/util.c
index bd166d2dd07c39aa4608a64689d393e7ebe71890..3e6269fd843f24966c322bf5fca3dfe844800087 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1415,11 +1415,6 @@ printcall(struct tcb *tcp)
 
 #  ifdef IA64
 
-/* We don't have fork()/vfork() syscalls on ia64 itself, but the ia32
-   subsystem has them for x86... */
-#   define SYS_fork    2
-#   define SYS_vfork   190
-
 typedef unsigned long *arg_setup_state;
 
 static int
@@ -1449,7 +1444,6 @@ arg_setup(struct tcb *tcp, arg_setup_state *state)
 
 #   define arg_finish_change(tcp, state)       0
 
-#   ifdef SYS_fork
 static int
 get_arg0(struct tcb *tcp, arg_setup_state *state, long *valp)
 {
@@ -1477,7 +1471,6 @@ get_arg1(struct tcb *tcp, arg_setup_state *state, long *valp)
                              sizeof(long), (void *) valp);
        return ret;
 }
-#   endif
 
 static int
 set_arg0(struct tcb *tcp, arg_setup_state *state, long val)
@@ -1644,14 +1637,8 @@ setbpt(struct tcb *tcp)
                        }
        }
 
-       switch (known_scno(tcp)) {
-#  ifdef SYS_vfork
-       case SYS_vfork:
-#  endif
-#  ifdef SYS_fork
-       case SYS_fork:
-#  endif
-#  if defined SYS_fork || defined SYS_vfork
+       if (sysent[tcp->scno].sys_func == sys_fork ||
+           sysent[tcp->scno].sys_func == sys_vfork) {
                if (arg_setup(tcp, &state) < 0
                    || get_arg0(tcp, &state, &tcp->inst[0]) < 0
                    || get_arg1(tcp, &state, &tcp->inst[1]) < 0
@@ -1664,14 +1651,11 @@ setbpt(struct tcb *tcp)
                tcp->u_arg[arg1_index] = 0;
                tcp->flags |= TCB_BPTSET;
                return 0;
-#  endif
+       }
 
-       case SYS_clone: ;
-#  ifdef SYS_clone2
-       case SYS_clone2: ;
-#  endif
+       if (sysent[tcp->scno].sys_func == sys_clone) {
                /* ia64 calls directly `clone (CLONE_VFORK | CLONE_VM)'
-                  contrary to x86 SYS_vfork above.  Even on x86 we turn the
+                  contrary to x86 vfork above.  Even on x86 we turn the
                   vfork semantics into plain fork - each application must not
                   depend on the vfork specifics according to POSIX.  We would
                   hang waiting for the parent resume otherwise.  We need to
@@ -1689,13 +1673,10 @@ setbpt(struct tcb *tcp)
                tcp->inst[0] = tcp->u_arg[arg0_index];
                tcp->inst[1] = tcp->u_arg[arg1_index];
                return 0;
-
-       default:
-               fprintf(stderr, "PANIC: setbpt for syscall %ld on %u???\n",
-                       tcp->scno, tcp->pid);
-               break;
        }
 
+       fprintf(stderr, "PANIC: setbpt for syscall %ld on %u???\n",
+               tcp->scno, tcp->pid);
        return -1;
 }