diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index 9c289e2d..5ee5088c 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -1031,7 +1031,7 @@ { 5, 0, printargs, "vm86" }, /* 1125 */ { 4, TP, sys_wait4, "wait4" }, /* 1126 */ { 1, 0, sys_sysinfo, "sysinfo" }, /* 1127 */ - { 2, TP, sys_clone, "clone" }, /* 1128 */ + { 4, TP, sys_clone, "clone" }, /* 1128 */ { 2, 0, sys_setdomainname, "setdomainname" }, /* 1129 */ { 1, 0, sys_uname, "uname" }, /* 1130 */ { 1, 0, sys_adjtimex, "adjtimex" }, /* 1131 */ @@ -1116,7 +1116,7 @@ { 2, TF, sys_stat, "stat" }, /* 1210 */ { 2, 0, sys_lstat, "lstat" }, /* 1211 */ { 2, TF, sys_fstat, "fstat" }, /* 1212 */ - { 2, TP, sys_clone2, "clone2" }, /* 1213 */ + { 6, TP, sys_clone, "clone2" }, /* 1213 */ { 3, 0, printargs, "getdents64" }, /* 1214 */ { 2, 0, printargs, "getunwind" }, /* 1215 */ { 4, 0, sys_readahead, "readahead" }, /* 1216 */ diff --git a/linux/syscall.h b/linux/syscall.h index 51d0139e..f9266ed9 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -83,7 +83,7 @@ int sys_rt_sigpending(), sys_rt_sigsuspend(), sys_rt_sigqueueinfo(); int sys_rt_sigtimedwait(), sys_prctl(), sys_poll(), sys_vfork(); int sys_sendfile(), sys_old_mmap(), sys_stat64(), sys_lstat64(), sys_fstat64(); int sys_truncate64(), sys_ftruncate64(), sys_pivotroot(); -int sys_getdents64(), sys_clone2(); +int sys_getdents64(); int sys_getpmsg(), sys_putpmsg(), sys_readahead(), sys_sendfile64(); int sys_setxattr(), sys_fsetxattr(), sys_getxattr(), sys_fgetxattr(); int sys_listxattr(), sys_flistxattr(), sys_removexattr(), sys_fremovexattr(); diff --git a/process.c b/process.c index d691f10b..a1fc3475 100644 --- a/process.c +++ b/process.c @@ -525,39 +525,57 @@ static struct xlat clone_flags[] = { extern void print_ldt_entry(); # endif +# if defined IA64 +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_STACKSIZE (tcp->scno == SYS_clone2 ? 2 : -1) +# define ARG_PTID (tcp->scno == SYS_clone2 ? 3 : -1) +# define ARG_CTID (tcp->scno == SYS_clone2 ? 4 : 2) +# define ARG_TLS (tcp->scno == SYS_clone2 ? 5 : 3) +# elif defined S390 +# define ARG_STACK 0 +# define ARG_FLAGS 1 +# define ARG_PTID 2 +# define ARG_TLS 3 +# define ARG_CTID 4 +# else +# define ARG_FLAGS 0 +# define ARG_STACK 1 +# define ARG_PTID 2 +# define ARG_TLS 3 +# define ARG_CTID 4 +# endif + int sys_clone(tcp) struct tcb *tcp; { if (exiting(tcp)) { - long flags, stack; -# if defined S390 || defined S390X - /* For some reason, S390 has the stack argument first. */ - stack = tcp->u_arg[0]; - flags = tcp->u_arg[1]; -# else - flags = tcp->u_arg[0]; - stack = tcp->u_arg[1]; + unsigned long flags = tcp->u_arg[ARG_FLAGS]; + tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]); +# ifdef ARG_STACKSIZE + if (ARG_STACKSIZE != -1) + tprintf("stack_size=%#lx, ", + tcp->u_arg[ARG_STACKSIZE]); # endif - tprintf("child_stack=%#lx, flags=", stack); + tprintf("flags="); if (printflags(clone_flags, flags) == 0) tprintf("0"); if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID - |CLONE_SETTLS)) == 0) + |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0) return 0; if (flags & CLONE_PARENT_SETTID) { int pid; - if (umove(tcp, tcp->u_arg[2], &pid) == 0) - tprintf(", [%d]", pid); + if (umove(tcp, tcp->u_arg[ARG_PTID], &pid) == 0) + tprintf(", parent_tidptr=[%d]", pid); else - tprintf(", %#lx", tcp->u_arg[2]); + tprintf(", parent_tidptr=%#lx", + tcp->u_arg[ARG_PTID]); } - else - tprintf(", "); -#ifdef I386 if (flags & CLONE_SETTLS) { +# ifdef I386 struct modify_ldt_ldt_s copy; - if (umove(tcp, tcp->u_arg[3], ©) != -1) { + if (umove(tcp, tcp->u_arg[ARG_TLS], ©) != -1) { tprintf(", {entry_number:%d, ", copy.entry_number); if (!verbose(tcp)) @@ -566,34 +584,14 @@ struct tcb *tcp; print_ldt_entry(©); } else - tprintf(", %#lx", tcp->u_arg[3]); +# endif + tprintf(", %#lx", tcp->u_arg[ARG_TLS]); } - else - tprintf(", "); -# define TIDARG 4 -#else -# define TIDARG 3 -#endif - if (flags & CLONE_CHILD_SETTID) - tprintf(", %#lx", tcp->u_arg[TIDARG]); -#undef TIDARG + if (flags & (CLONE_CHILD_SETTID|CLONE_CHILD_CLEARTID)) + tprintf(", child_tidptr=%#lx", tcp->u_arg[ARG_CTID]); } return 0; } - -int -sys_clone2(tcp) -struct tcb *tcp; -{ - if (exiting(tcp)) { - tprintf("child_stack=%#lx, stack_size=%#lx, flags=", - tcp->u_arg[1], tcp->u_arg[2]); - if (printflags(clone_flags, tcp->u_arg[0]) == 0) - tprintf("0"); - } - return 0; -} - #endif int