Lines Matching refs:tcp
284 sys_prctl(tcp) in sys_prctl() argument
285 struct tcb *tcp; in sys_prctl()
289 if (entering(tcp)) {
290 printxval(prctl_options, tcp->u_arg[0], "PR_???");
291 switch (tcp->u_arg[0]) {
298 tprintf(", %lu", tcp->u_arg[1]);
307 tprintf(", %lu", tcp->u_arg[1]);
316 tprintf(", %s", unalignctl_string(tcp->u_arg[1]));
321 tprintf(", %#lx", tcp->u_arg[1]);
326 tprintf(", %lu", tcp->u_arg[1]);
334 for (i = 1; i < tcp->u_nargs; i++)
335 tprintf(", %#lx", tcp->u_arg[i]);
339 switch (tcp->u_arg[0]) {
342 if (umove(tcp, tcp->u_arg[1], &i) < 0)
343 tprintf(", %#lx", tcp->u_arg[1]);
354 if (syserror(tcp) || umove(tcp, tcp->u_arg[1], &i) < 0)
356 tcp->auxstr = unalignctl_string(i);
373 sys_gethostid(tcp) in sys_gethostid() argument
374 struct tcb *tcp; in sys_gethostid()
376 if (exiting(tcp))
383 sys_sethostname(tcp) in sys_sethostname() argument
384 struct tcb *tcp; in sys_sethostname()
386 if (entering(tcp)) {
387 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
388 tprintf(", %lu", tcp->u_arg[1]);
395 sys_gethostname(tcp) in sys_gethostname() argument
396 struct tcb *tcp; in sys_gethostname()
398 if (exiting(tcp)) {
399 if (syserror(tcp))
400 tprintf("%#lx", tcp->u_arg[0]);
402 printpath(tcp, tcp->u_arg[0]);
403 tprintf(", %lu", tcp->u_arg[1]);
410 sys_setdomainname(tcp) in sys_setdomainname() argument
411 struct tcb *tcp; in sys_setdomainname()
413 if (entering(tcp)) {
414 printpathn(tcp, tcp->u_arg[0], tcp->u_arg[1]);
415 tprintf(", %lu", tcp->u_arg[1]);
423 sys_getdomainname(tcp) in sys_getdomainname() argument
424 struct tcb *tcp; in sys_getdomainname()
426 if (exiting(tcp)) {
427 if (syserror(tcp))
428 tprintf("%#lx", tcp->u_arg[0]);
430 printpath(tcp, tcp->u_arg[0]);
431 tprintf(", %lu", tcp->u_arg[1]);
438 sys_exit(tcp) in sys_exit() argument
439 struct tcb *tcp; in sys_exit()
441 if (exiting(tcp)) {
446 tprintf("%ld) ", tcp->u_arg[0]);
454 internal_exit(struct tcb *tcp) in internal_exit() argument
456 if (entering(tcp)) { in internal_exit()
457 tcp->flags |= TCB_EXITING; in internal_exit()
459 if (known_scno(tcp) == __NR_exit_group) in internal_exit()
460 tcp->flags |= TCB_GROUP_EXITING; in internal_exit()
470 fork_tcb(struct tcb *tcp) in fork_tcb() argument
475 tcp->flags |= TCB_FOLLOWFORK; in fork_tcb()
481 sys_fork(struct tcb *tcp) in sys_fork() argument
483 if (exiting(tcp) && !syserror(tcp)) { in sys_fork()
484 if (getrval2(tcp)) { in sys_fork()
485 tcp->auxstr = "child process"; in sys_fork()
495 sys_rfork(tcp) in sys_rfork() argument
496 struct tcb *tcp; in sys_rfork()
498 if (entering(tcp)) {
499 tprintf ("%ld", tcp->u_arg[0]);
501 else if (!syserror(tcp)) {
502 if (getrval2(tcp)) {
503 tcp->auxstr = "child process";
513 internal_fork(tcp) in internal_fork() argument
514 struct tcb *tcp; in internal_fork()
518 if (exiting(tcp)) {
520 if (known_scno(tcp) == SYS_rfork && !(tcp->u_arg[0]&RFPROC))
523 if (getrval2(tcp))
527 fork_tcb(tcp);
528 if (syserror(tcp))
530 tcpchild = alloctcb(tcp->u_rval);
607 # define ARG_STACKSIZE (known_scno(tcp) == SYS_clone2 ? 2 : -1)
608 # define ARG_PTID (known_scno(tcp) == SYS_clone2 ? 3 : 2)
609 # define ARG_CTID (known_scno(tcp) == SYS_clone2 ? 4 : 3)
610 # define ARG_TLS (known_scno(tcp) == SYS_clone2 ? 5 : 4)
632 sys_clone(tcp) in sys_clone() argument
633 struct tcb *tcp; in sys_clone()
635 if (exiting(tcp)) {
637 unsigned long flags = tcp->u_arg[ARG_FLAGS];
638 tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]);
642 tcp->u_arg[ARG_STACKSIZE]);
653 tprintf(", parent_tidptr=%#lx", tcp->u_arg[ARG_PTID]);
657 if (umove(tcp, tcp->u_arg[ARG_TLS], ©) != -1) {
660 if (!verbose(tcp))
667 tprintf(", tls=%#lx", tcp->u_arg[ARG_TLS]);
670 tprintf(", child_tidptr=%#lx", tcp->u_arg[ARG_CTID]);
676 sys_unshare(struct tcb *tcp) in sys_unshare() argument
678 if (entering(tcp)) in sys_unshare()
679 printflags(clone_flags, tcp->u_arg[0], "CLONE_???"); in sys_unshare()
685 sys_fork(tcp) in sys_fork() argument
686 struct tcb *tcp; in sys_fork()
688 if (exiting(tcp))
694 change_syscall(struct tcb *tcp, int new) in change_syscall() argument
699 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_EAX * 4), new) < 0) in change_syscall()
704 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(ORIG_RAX * 8), new) < 0) in change_syscall()
708 if (ptrace(PTRACE_POKEUSER, tcp->pid, in change_syscall()
714 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GPR2), new)<0) in change_syscall()
718 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_ORIG_D0), new)<0) in change_syscall()
723 if (ptrace(PTRACE_GETREGS, tcp->pid, (char*)®s, 0)<0) in change_syscall()
726 if (ptrace(PTRACE_SETREGS, tcp->pid, (char*)®s, 0)<0) in change_syscall()
730 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_V0), new)<0) in change_syscall()
734 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_A3), new)<0) in change_syscall()
738 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_R8), new) < 0) in change_syscall()
742 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_P0), new)<0) in change_syscall()
758 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R1), new)<0) in change_syscall()
760 } else if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_R15), new)<0) in change_syscall()
764 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GR20), new)<0) in change_syscall()
768 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*(REG_REG0+3)), new)<0) in change_syscall()
774 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(REG_SYSCALL), in change_syscall()
779 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(4*PT_R9), new) < 0) in change_syscall()
788 if (ptrace (PTRACE_SET_SYSCALL, tcp->pid, 0, new & 0xffff) != 0) in change_syscall()
793 if (ptrace(PTRACE_POKEUSER, tcp->pid, in change_syscall()
799 if (ptrace(PTRACE_POKEUSER, tcp->pid, (char*)(PT_GPR(0)), new)<0) in change_syscall()
811 handle_new_child(struct tcb *tcp, int pid, int bpt) in handle_new_child() argument
825 pid, tcp->pid); in handle_new_child()
830 fork_tcb(tcp); in handle_new_child()
838 clearbpt(tcp); in handle_new_child()
847 clearbpt(tcp); in handle_new_child()
853 tcpchild->baddr = tcp->baddr; in handle_new_child()
854 memcpy(tcpchild->inst, tcp->inst, in handle_new_child()
857 tcpchild->parent = tcp; in handle_new_child()
858 tcp->nchildren++; in handle_new_child()
872 pid, tcp->pid); in handle_new_child()
880 if (sysent[tcp->scno].sys_func == sys_clone) in handle_new_child()
886 int call_flags = tcp->u_arg[ARG_FLAGS]; in handle_new_child()
887 if ((tcp->flags & TCB_CLONE_THREAD) && in handle_new_child()
888 tcp->parent != NULL) { in handle_new_child()
899 --tcp->nchildren; in handle_new_child()
900 tcp = tcp->parent; in handle_new_child()
901 tcpchild->parent = tcp; in handle_new_child()
902 ++tcp->nchildren; in handle_new_child()
906 ++tcp->nclone_threads; in handle_new_child()
910 --tcp->nchildren; in handle_new_child()
912 if (tcp->parent != NULL) { in handle_new_child()
913 tcp = tcp->parent; in handle_new_child()
914 tcpchild->parent = tcp; in handle_new_child()
915 ++tcp->nchildren; in handle_new_child()
924 internal_fork(struct tcb *tcp) in internal_fork() argument
931 if (entering(tcp)) { in internal_fork()
932 tcp->flags &= ~TCB_FOLLOWFORK; in internal_fork()
940 if ((sysent[tcp->scno].sys_func == sys_clone) && in internal_fork()
941 (tcp->u_arg[ARG_FLAGS] & CLONE_UNTRACED)) in internal_fork()
943 fork_tcb(tcp); in internal_fork()
944 if (setbpt(tcp) < 0) in internal_fork()
950 if (!(tcp->flags & TCB_FOLLOWFORK)) in internal_fork()
953 bpt = tcp->flags & TCB_BPTSET; in internal_fork()
955 if (syserror(tcp)) { in internal_fork()
957 clearbpt(tcp); in internal_fork()
961 pid = tcp->u_rval; in internal_fork()
963 return handle_new_child(tcp, pid, bpt); in internal_fork()
971 internal_fork(tcp) in internal_fork() argument
972 struct tcb *tcp; in internal_fork()
979 if (known_scno(tcp) == SYS_vfork) {
981 if (change_syscall(tcp, SYS_fork) < 0)
985 if (entering(tcp)) {
988 fork_tcb(tcp);
989 if (setbpt(tcp) < 0)
993 int bpt = tcp->flags & TCB_BPTSET;
995 if (!(tcp->flags & TCB_FOLLOWFORK))
998 clearbpt(tcp);
1000 if (syserror(tcp))
1003 pid = tcp->u_rval;
1004 fork_tcb(tcp);
1041 tcpchild->baddr = tcp->baddr;
1042 memcpy(tcpchild->inst, tcp->inst,
1045 tcpchild->parent = tcp;
1046 tcp->nchildren++;
1060 sys_vfork(tcp) in sys_vfork() argument
1061 struct tcb *tcp; in sys_vfork()
1063 if (exiting(tcp))
1075 sys_getpid(tcp) in sys_getpid() argument
1076 struct tcb *tcp; in sys_getpid()
1078 if (exiting(tcp)) {
1079 sprintf(idstr, "ppid %lu", getrval2(tcp));
1080 tcp->auxstr = idstr;
1087 sys_getuid(tcp) in sys_getuid() argument
1088 struct tcb *tcp; in sys_getuid()
1090 if (exiting(tcp)) {
1091 sprintf(idstr, "euid %lu", getrval2(tcp));
1092 tcp->auxstr = idstr;
1099 sys_getgid(tcp) in sys_getgid() argument
1100 struct tcb *tcp; in sys_getgid()
1102 if (exiting(tcp)) {
1103 sprintf(idstr, "egid %lu", getrval2(tcp));
1104 tcp->auxstr = idstr;
1114 int sys_getuid(struct tcb *tcp) in sys_getuid() argument
1116 if (exiting(tcp)) in sys_getuid()
1117 tcp->u_rval = (uid_t) tcp->u_rval; in sys_getuid()
1121 int sys_setfsuid(struct tcb *tcp) in sys_setfsuid() argument
1123 if (entering(tcp)) in sys_setfsuid()
1124 tprintf("%u", (uid_t) tcp->u_arg[0]); in sys_setfsuid()
1126 tcp->u_rval = (uid_t) tcp->u_rval; in sys_setfsuid()
1131 sys_setuid(tcp) in sys_setuid() argument
1132 struct tcb *tcp; in sys_setuid()
1134 if (entering(tcp)) {
1135 tprintf("%u", (uid_t) tcp->u_arg[0]);
1141 sys_setgid(tcp) in sys_setgid() argument
1142 struct tcb *tcp; in sys_setgid()
1144 if (entering(tcp)) {
1145 tprintf("%u", (gid_t) tcp->u_arg[0]);
1151 sys_getresuid(struct tcb *tcp) in sys_getresuid() argument
1153 if (exiting(tcp)) { in sys_getresuid()
1155 if (syserror(tcp)) in sys_getresuid()
1156 tprintf("%#lx, %#lx, %#lx", tcp->u_arg[0], in sys_getresuid()
1157 tcp->u_arg[1], tcp->u_arg[2]); in sys_getresuid()
1159 if (umove(tcp, tcp->u_arg[0], &uid) < 0) in sys_getresuid()
1160 tprintf("%#lx, ", tcp->u_arg[0]); in sys_getresuid()
1163 if (umove(tcp, tcp->u_arg[1], &uid) < 0) in sys_getresuid()
1164 tprintf("%#lx, ", tcp->u_arg[1]); in sys_getresuid()
1167 if (umove(tcp, tcp->u_arg[2], &uid) < 0) in sys_getresuid()
1168 tprintf("%#lx", tcp->u_arg[2]); in sys_getresuid()
1177 sys_getresgid(tcp) in sys_getresgid() argument
1178 struct tcb *tcp; in sys_getresgid()
1180 if (exiting(tcp)) {
1182 if (syserror(tcp))
1183 tprintf("%#lx, %#lx, %#lx", tcp->u_arg[0],
1184 tcp->u_arg[1], tcp->u_arg[2]);
1186 if (umove(tcp, tcp->u_arg[0], &gid) < 0)
1187 tprintf("%#lx, ", tcp->u_arg[0]);
1190 if (umove(tcp, tcp->u_arg[1], &gid) < 0)
1191 tprintf("%#lx, ", tcp->u_arg[1]);
1194 if (umove(tcp, tcp->u_arg[2], &gid) < 0)
1195 tprintf("%#lx", tcp->u_arg[2]);
1206 sys_setreuid(tcp) in sys_setreuid() argument
1207 struct tcb *tcp; in sys_setreuid()
1209 if (entering(tcp)) {
1210 printuid("", tcp->u_arg[0]);
1211 printuid(", ", tcp->u_arg[1]);
1217 sys_setregid(tcp) in sys_setregid() argument
1218 struct tcb *tcp; in sys_setregid()
1220 if (entering(tcp)) {
1221 printuid("", tcp->u_arg[0]);
1222 printuid(", ", tcp->u_arg[1]);
1229 sys_setresuid(tcp) in sys_setresuid() argument
1230 struct tcb *tcp; in sys_setresuid()
1232 if (entering(tcp)) {
1233 printuid("", tcp->u_arg[0]);
1234 printuid(", ", tcp->u_arg[1]);
1235 printuid(", ", tcp->u_arg[2]);
1240 sys_setresgid(tcp) in sys_setresgid() argument
1241 struct tcb *tcp; in sys_setresgid()
1243 if (entering(tcp)) {
1244 printuid("", tcp->u_arg[0]);
1245 printuid(", ", tcp->u_arg[1]);
1246 printuid(", ", tcp->u_arg[2]);
1254 sys_setgroups(tcp) in sys_setgroups() argument
1255 struct tcb *tcp; in sys_setgroups()
1257 if (entering(tcp)) {
1262 len = tcp->u_arg[0];
1268 start = tcp->u_arg[1];
1275 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
1279 if (abbrev(tcp)) {
1294 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
1303 tprintf(" %#lx", tcp->u_arg[1]);
1309 sys_getgroups(tcp) in sys_getgroups() argument
1310 struct tcb *tcp; in sys_getgroups()
1314 if (entering(tcp)) {
1315 len = tcp->u_arg[0];
1322 len = tcp->u_rval;
1327 start = tcp->u_arg[1];
1332 if (tcp->u_arg[0] == 0) {
1338 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
1343 if (abbrev(tcp)) {
1358 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
1367 tprintf(" %#lx", tcp->u_arg[1]);
1374 sys_setgroups32(tcp) in sys_setgroups32() argument
1375 struct tcb *tcp; in sys_setgroups32()
1377 if (entering(tcp)) {
1382 len = tcp->u_arg[0];
1388 start = tcp->u_arg[1];
1395 if (!verbose(tcp) || size / sizeof(gid) != len || end < start) {
1399 if (abbrev(tcp)) {
1414 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
1423 tprintf(" %#lx", tcp->u_arg[1]);
1429 sys_getgroups32(tcp) in sys_getgroups32() argument
1430 struct tcb *tcp; in sys_getgroups32()
1434 if (entering(tcp)) {
1435 len = tcp->u_arg[0];
1442 len = tcp->u_rval;
1447 start = tcp->u_arg[1];
1454 if (!verbose(tcp) || tcp->u_arg[0] == 0 ||
1459 if (abbrev(tcp)) {
1474 if (umoven(tcp, cur, sizeof(gid), (char *) &gid) < 0) {
1483 tprintf(" %#lx", tcp->u_arg[1]);
1491 sys_setpgrp(tcp) in sys_setpgrp() argument
1492 struct tcb *tcp; in sys_setpgrp()
1494 if (entering(tcp)) {
1496 tprintf("%lu, %lu", tcp->u_arg[0], tcp->u_arg[1]);
1504 sys_getpgrp(tcp) in sys_getpgrp() argument
1505 struct tcb *tcp; in sys_getpgrp()
1507 if (entering(tcp)) {
1509 tprintf("%lu", tcp->u_arg[0]);
1516 sys_getsid(tcp) in sys_getsid() argument
1517 struct tcb *tcp; in sys_getsid()
1519 if (entering(tcp)) {
1520 tprintf("%lu", tcp->u_arg[0]);
1526 sys_setsid(tcp) in sys_setsid() argument
1527 struct tcb *tcp; in sys_setsid()
1533 sys_getpgid(tcp) in sys_getpgid() argument
1534 struct tcb *tcp; in sys_getpgid()
1536 if (entering(tcp)) {
1537 tprintf("%lu", tcp->u_arg[0]);
1543 sys_setpgid(tcp) in sys_setpgid() argument
1544 struct tcb *tcp; in sys_setpgid()
1546 if (entering(tcp)) {
1547 tprintf("%lu, %lu", tcp->u_arg[0], tcp->u_arg[1]);
1610 printpriv(struct tcb *tcp, long addr, int len, const struct xlat *opt) in printpriv() argument
1613 int max = verbose (tcp) ? sizeof buf / sizeof buf [0] : 10; in printpriv()
1620 umoven (tcp, addr, len * sizeof buf[0], (char *) buf) < 0) in printpriv()
1650 sys_procpriv(tcp) in sys_procpriv() argument
1651 struct tcb *tcp; in sys_procpriv()
1653 if (entering(tcp)) {
1654 printxval(procpriv_cmds, tcp->u_arg[0], "???PRV");
1655 switch (tcp->u_arg[0]) {
1657 tprintf(", %#lx, %ld", tcp->u_arg[1], tcp->u_arg[2]);
1665 printpriv (tcp, tcp->u_arg[1], tcp->u_arg[2]);
1666 tprintf (", %ld", tcp->u_arg[2]);
1669 else if (tcp->u_arg[0] == GETPRV) {
1670 if (syserror (tcp)) {
1671 tprintf(", %#lx, %ld", tcp->u_arg[1], tcp->u_arg[2]);
1675 printpriv (tcp, tcp->u_arg[1], tcp->u_rval);
1676 tprintf (", %ld", tcp->u_arg[2]);
1687 printargv(struct tcb *tcp, long addr) in printargv() argument
1698 for (sep = ""; !abbrev(tcp) || n < max_strlen / 2; sep = ", ", ++n) { in printargv()
1699 if (umoven(tcp, addr, personality_wordsize[current_personality], in printargv()
1709 printstr(tcp, cp.p64, -1); in printargv()
1717 printargc(const char *fmt, struct tcb *tcp, long addr) in printargc() argument
1722 for (count = 0; umove(tcp, addr, &cp) >= 0 && cp != NULL; count++) { in printargc()
1730 sys_execv(struct tcb *tcp) in sys_execv() argument
1732 if (entering(tcp)) { in sys_execv()
1733 printpath(tcp, tcp->u_arg[0]); in sys_execv()
1734 if (!verbose(tcp)) in sys_execv()
1735 tprintf(", %#lx", tcp->u_arg[1]); in sys_execv()
1738 printargv(tcp, tcp->u_arg[1]); in sys_execv()
1747 sys_execve(struct tcb *tcp) in sys_execve() argument
1749 if (entering(tcp)) { in sys_execve()
1750 printpath(tcp, tcp->u_arg[0]); in sys_execve()
1751 if (!verbose(tcp)) in sys_execve()
1752 tprintf(", %#lx", tcp->u_arg[1]); in sys_execve()
1755 printargv(tcp, tcp->u_arg[1]); in sys_execve()
1758 if (!verbose(tcp)) in sys_execve()
1759 tprintf(", %#lx", tcp->u_arg[2]); in sys_execve()
1760 else if (abbrev(tcp)) in sys_execve()
1761 printargc(", [/* %d var%s */]", tcp, tcp->u_arg[2]); in sys_execve()
1764 printargv(tcp, tcp->u_arg[2]); in sys_execve()
1773 int sys_rexecve(tcp) in sys_rexecve() argument
1774 struct tcb *tcp; in sys_rexecve()
1776 if (entering (tcp)) {
1777 sys_execve (tcp);
1778 tprintf (", %ld", tcp->u_arg[3]);
1786 internal_exec(tcp) in internal_exec() argument
1787 struct tcb *tcp; in internal_exec()
1790 if (exiting(tcp) && !syserror(tcp) && followfork)
1791 fixvfork(tcp);
1794 if (exiting(tcp) && syserror(tcp))
1795 tcp->flags &= ~TCB_WAITEXECVE;
1797 tcp->flags |= TCB_WAITEXECVE;
1906 printwaitn(struct tcb *tcp, int n, int bitness) in printwaitn() argument
1913 if (entering(tcp)) { in printwaitn()
1921 int pid = tcp->u_arg[0]; in printwaitn()
1927 long pid = tcp->u_arg[0]; in printwaitn()
1934 if (!tcp->u_arg[1]) in printwaitn()
1936 else if (syserror(tcp) || tcp->u_rval == 0) in printwaitn()
1937 tprintf("%#lx", tcp->u_arg[1]); in printwaitn()
1938 else if (umove(tcp, tcp->u_arg[1], &status) < 0) in printwaitn()
1947 printflags(wait4_options, tcp->u_arg[2], "W???"); in printwaitn()
1951 if (!tcp->u_arg[3]) in printwaitn()
1954 else if (tcp->u_rval > 0) { in printwaitn()
1957 printrusage32(tcp, tcp->u_arg[3]); in printwaitn()
1960 printrusage(tcp, tcp->u_arg[3]); in printwaitn()
1964 else if (tcp->u_rval > 0 && exited) in printwaitn()
1965 printrusage(tcp, tcp->u_arg[3]); in printwaitn()
1968 tprintf("%#lx", tcp->u_arg[3]); in printwaitn()
1975 internal_wait(tcp, flagarg) in internal_wait() argument
1976 struct tcb *tcp; in internal_wait()
1982 if (tcp->flags & TCB_CLONE_THREAD)
1984 got_kids = (tcp->parent->nchildren
1985 > tcp->parent->nclone_threads);
1987 got_kids = (tcp->nchildren > tcp->nclone_threads);
1989 got_kids = tcp->nchildren > 0;
1992 if (entering(tcp) && got_kids) {
2003 if (!(tcp->u_arg[flagarg] & WNOHANG)) {
2012 if (tcp->nzombies > 0 &&
2013 (tcp->u_arg[0] == -1 ||
2014 (child = pid2tcb(tcp->u_arg[0])) == NULL))
2016 if (tcp->u_arg[0] > 0) {
2026 child = pid2tcb(tcp->u_arg[0]);
2029 (tcp->flags & TCB_CLONE_THREAD)
2030 ? tcp->parent :
2032 tcp) ||
2036 tcp->flags |= TCB_SUSPENDED;
2037 tcp->waitpid = tcp->u_arg[0];
2039 if (tcp->flags & TCB_CLONE_THREAD)
2040 tcp->parent->nclone_waiting++;
2044 if (exiting(tcp) && tcp->u_error == ECHILD && got_kids) {
2045 if (tcp->u_arg[flagarg] & WNOHANG) {
2048 return force_result(tcp, 0, 0);
2051 else if (exiting(tcp) && tcp->u_error == 0 && tcp->u_rval > 0 &&
2052 tcp->nzombies > 0 && pid2tcb(tcp->u_rval) == NULL) {
2057 tcp->nzombies--;
2065 sys_wait(tcp) in sys_wait() argument
2066 struct tcb *tcp; in sys_wait()
2068 if (exiting(tcp)) {
2070 if (!syserror(tcp))
2071 printstatus(getrval2(tcp));
2080 sys_wait(tcp) in sys_wait() argument
2081 struct tcb *tcp; in sys_wait()
2085 if (exiting(tcp)) {
2086 if (!syserror(tcp)) {
2087 if (umove(tcp, tcp->u_arg[0], &status) < 0)
2088 tprintf("%#lx", tcp->u_arg[0]);
2098 sys_waitpid(tcp) in sys_waitpid() argument
2099 struct tcb *tcp; in sys_waitpid()
2101 return printwaitn(tcp, 3, 0);
2105 sys_wait4(tcp) in sys_wait4() argument
2106 struct tcb *tcp; in sys_wait4()
2108 return printwaitn(tcp, 4, 0);
2113 sys_osf_wait4(tcp) in sys_osf_wait4() argument
2114 struct tcb *tcp; in sys_osf_wait4()
2116 return printwaitn(tcp, 4, 1);
2148 sys_waitid(struct tcb *tcp) in sys_waitid() argument
2152 if (entering(tcp)) { in sys_waitid()
2153 printxval(waitid_types, tcp->u_arg[0], "P_???"); in sys_waitid()
2154 tprintf(", %ld, ", tcp->u_arg[1]); in sys_waitid()
2158 if (!tcp->u_arg[2]) in sys_waitid()
2160 else if (syserror(tcp)) in sys_waitid()
2161 tprintf("%#lx", tcp->u_arg[2]); in sys_waitid()
2162 else if (umove(tcp, tcp->u_arg[2], &si) < 0) in sys_waitid()
2165 printsiginfo(&si, verbose(tcp)); in sys_waitid()
2168 printflags(wait4_options, tcp->u_arg[3], "W???"); in sys_waitid()
2169 if (tcp->u_nargs > 4) { in sys_waitid()
2172 if (!tcp->u_arg[4]) in sys_waitid()
2174 else if (tcp->u_error) in sys_waitid()
2175 tprintf("%#lx", tcp->u_arg[4]); in sys_waitid()
2177 printrusage(tcp, tcp->u_arg[4]); in sys_waitid()
2186 sys_alarm(tcp) in sys_alarm() argument
2187 struct tcb *tcp; in sys_alarm()
2189 if (entering(tcp))
2190 tprintf("%lu", tcp->u_arg[0]);
2195 sys_uname(tcp) in sys_uname() argument
2196 struct tcb *tcp; in sys_uname()
2200 if (exiting(tcp)) {
2201 if (syserror(tcp) || !verbose(tcp))
2202 tprintf("%#lx", tcp->u_arg[0]);
2203 else if (umove(tcp, tcp->u_arg[0], &uname) < 0)
2205 else if (!abbrev(tcp)) {
3300 sys_ptrace(struct tcb *tcp) in sys_ptrace() argument
3305 if (entering(tcp)) { in sys_ptrace()
3306 printxval(ptrace_cmds, tcp->u_arg[0], in sys_ptrace()
3313 tprintf(", %lu, ", tcp->u_arg[1]); in sys_ptrace()
3314 addr = tcp->u_arg[2]; in sys_ptrace()
3316 if (tcp->u_arg[0] == PTRACE_PEEKUSER in sys_ptrace()
3317 || tcp->u_arg[0] == PTRACE_POKEUSER) { in sys_ptrace()
3333 tprintf("%#lx, ", tcp->u_arg[2]); in sys_ptrace()
3335 switch (tcp->u_arg[0]) { in sys_ptrace()
3346 printsignal(tcp->u_arg[3]); in sys_ptrace()
3350 printflags(ptrace_setoptions_flags, tcp->u_arg[3], "PTRACE_O_???"); in sys_ptrace()
3356 if (!tcp->u_arg[3]) in sys_ptrace()
3358 else if (syserror(tcp)) in sys_ptrace()
3359 tprintf("%#lx", tcp->u_arg[3]); in sys_ptrace()
3360 else if (umove(tcp, tcp->u_arg[3], &si) < 0) in sys_ptrace()
3363 printsiginfo(&si, verbose(tcp)); in sys_ptrace()
3373 tprintf("%#lx", tcp->u_arg[3]); in sys_ptrace()
3377 switch (tcp->u_arg[0]) { in sys_ptrace()
3384 printnum(tcp, tcp->u_arg[3], "%#lx"); in sys_ptrace()
3390 if (!tcp->u_arg[3]) in sys_ptrace()
3392 else if (syserror(tcp)) in sys_ptrace()
3393 tprintf("%#lx", tcp->u_arg[3]); in sys_ptrace()
3394 else if (umove(tcp, tcp->u_arg[3], &si) < 0) in sys_ptrace()
3397 printsiginfo(&si, verbose(tcp)); in sys_ptrace()
3405 if (tcp->u_arg[0] == PTRACE_WRITEDATA || in sys_ptrace()
3406 tcp->u_arg[0] == PTRACE_WRITETEXT) { in sys_ptrace()
3407 tprintf("%lu, ", tcp->u_arg[3]); in sys_ptrace()
3408 printstr(tcp, tcp->u_arg[4], tcp->u_arg[3]); in sys_ptrace()
3409 } else if (tcp->u_arg[0] != PTRACE_READDATA && in sys_ptrace()
3410 tcp->u_arg[0] != PTRACE_READTEXT) { in sys_ptrace()
3411 tprintf("%#lx", tcp->u_arg[3]); in sys_ptrace()
3414 if (tcp->u_arg[0] == PTRACE_READDATA ||
3415 tcp->u_arg[0] == PTRACE_READTEXT) {
3416 tprintf("%lu, ", tcp->u_arg[3]);
3417 printstr(tcp, tcp->u_arg[4], tcp->u_arg[3]);
3422 tprintf("%lu", tcp->u_arg[3]);
3525 sys_futex(struct tcb *tcp)
3527 if (entering(tcp)) {
3528 long int cmd = tcp->u_arg[1] & 127;
3529 tprintf("%p, ", (void *) tcp->u_arg[0]);
3530 printxval(futexops, tcp->u_arg[1], "FUTEX_???");
3531 tprintf(", %ld", tcp->u_arg[2]);
3533 tprintf(", %lx", tcp->u_arg[5]);
3536 printtv(tcp, tcp->u_arg[3]);
3539 printtv(tcp, tcp->u_arg[3]);
3540 tprintf(", %lx", tcp->u_arg[5]);
3542 tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]);
3544 tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]);
3546 tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
3547 if ((tcp->u_arg[5] >> 28) & 8)
3549 printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
3550 tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
3551 if ((tcp->u_arg[5] >> 24) & 8)
3553 printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
3554 tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
3557 printtv(tcp, tcp->u_arg[3]);
3558 tprintf(", %p", (void *) tcp->u_arg[4]);
3565 print_affinitylist(struct tcb *tcp, long list, unsigned int len)
3570 if (abbrev(tcp) && len / sizeof(w) > max_strlen)
3576 if (umove(tcp, list, &w) < 0)
3597 sys_sched_setaffinity(struct tcb *tcp)
3599 if (entering(tcp)) {
3600 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
3601 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]);
3607 sys_sched_getaffinity(struct tcb *tcp)
3609 if (entering(tcp)) {
3610 tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
3612 if (tcp->u_rval == -1)
3613 tprintf("%#lx", tcp->u_arg[2]);
3615 print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
3628 sys_sched_getscheduler(struct tcb *tcp)
3630 if (entering(tcp)) {
3631 tprintf("%d", (int) tcp->u_arg[0]);
3632 } else if (! syserror(tcp)) {
3633 tcp->auxstr = xlookup (schedulers, tcp->u_rval);
3634 if (tcp->auxstr != NULL)
3641 sys_sched_setscheduler(struct tcb *tcp)
3643 if (entering(tcp)) {
3645 tprintf("%d, ", (int) tcp->u_arg[0]);
3646 printxval(schedulers, tcp->u_arg[1], "SCHED_???");
3647 if (umove(tcp, tcp->u_arg[2], &p) < 0)
3648 tprintf(", %#lx", tcp->u_arg[2]);
3656 sys_sched_getparam(struct tcb *tcp)
3658 if (entering(tcp)) {
3659 tprintf("%d, ", (int) tcp->u_arg[0]);
3662 if (umove(tcp, tcp->u_arg[1], &p) < 0)
3663 tprintf("%#lx", tcp->u_arg[1]);
3671 sys_sched_setparam(struct tcb *tcp)
3673 if (entering(tcp)) {
3675 if (umove(tcp, tcp->u_arg[1], &p) < 0)
3676 tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
3678 tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
3684 sys_sched_get_priority_min(struct tcb *tcp)
3686 if (entering(tcp)) {
3687 printxval(schedulers, tcp->u_arg[0], "SCHED_???");
3704 sys_arch_prctl(struct tcb *tcp)
3706 if (entering(tcp)) {
3707 printxval(archvals, tcp->u_arg[0], "ARCH_???");
3708 if (tcp->u_arg[0] == ARCH_SET_GS
3709 || tcp->u_arg[0] == ARCH_SET_FS
3711 tprintf(", %#lx", tcp->u_arg[1]);
3714 if (tcp->u_arg[0] == ARCH_GET_GS
3715 || tcp->u_arg[0] == ARCH_GET_FS
3718 if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1)
3721 tprintf(", %#lx", tcp->u_arg[1]);
3730 sys_getcpu(struct tcb *tcp)
3732 if (exiting(tcp)) {
3734 if (tcp->u_arg[0] == 0)
3736 else if (umove(tcp, tcp->u_arg[0], &u) < 0)
3737 tprintf("%#lx, ", tcp->u_arg[0]);
3740 if (tcp->u_arg[1] == 0)
3742 else if (umove(tcp, tcp->u_arg[1], &u) < 0)
3743 tprintf("%#lx, ", tcp->u_arg[1]);
3746 tprintf("%#lx", tcp->u_arg[2]);