diff --git a/linux/syscall.h b/linux/syscall.h index 783dad5c..d7a7281f 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -103,6 +103,7 @@ int sys_mbind(), sys_get_mempolicy(), sys_set_mempolicy(), sys_move_pages(); int sys_arch_prctl(); int sys_io_setup(), sys_io_submit(), sys_io_cancel(), sys_io_getevents(), sys_io_destroy(); int sys_utimensat(), sys_epoll_pwait(), sys_signalfd(), sys_timerfd(), sys_eventfd(); +int sys_getcpu(); /* sys_socketcall subcalls */ diff --git a/linux/syscallent.h b/linux/syscallent.h index ba9e1178..eecef168 100644 --- a/linux/syscallent.h +++ b/linux/syscallent.h @@ -348,7 +348,7 @@ { 4, TD, printargs, "tee" }, /* 315 */ { 4, TD, printargs, "vmsplice" }, /* 316 */ { 6, 0, sys_move_pages, "move_pages" }, /* 317 */ - { 5, 0, printargs, "SYS_318" }, /* 318 */ + { 3, 0, sys_getcpu, "getcpu" }, /* 318 */ { 5, TD, sys_epoll_pwait, "epoll_pwait" }, /* 319 */ { 4, TD|TF, sys_utimensat, "utimensat" }, /* 320 */ { 3, TD|TS, sys_signalfd, "signalfd" }, /* 321 */ diff --git a/process.c b/process.c index 45f42b51..12d643bb 100644 --- a/process.c +++ b/process.c @@ -3325,4 +3325,28 @@ struct tcb *tcp; } #endif + +int +sys_getcpu(tcp) +struct tcb *tcp; +{ + if (exiting(tcp)) { + unsigned u; + if (tcp->u_arg[0] == 0) + tprintf("NULL, "); + else if (umove(tcp, tcp->u_arg[0], &u) < 0) + tprintf("%#lx, ", tcp->u_arg[0]); + else + tprintf("[%u], ", u); + if (tcp->u_arg[1] == 0) + tprintf("NULL, "); + else if (umove(tcp, tcp->u_arg[1], &u) < 0) + tprintf("%#lx, ", tcp->u_arg[1]); + else + tprintf("[%u], ", u); + tprintf("%#lx", tcp->u_arg[2]); + } + return 0; +} + #endif