Index: usr.bin/truss/setup.c =================================================================== --- usr.bin/truss/setup.c +++ usr.bin/truss/setup.c @@ -64,6 +64,7 @@ static void enter_syscall(struct trussinfo *, struct threadinfo *, struct ptrace_lwpinfo *); static void new_proc(struct trussinfo *, pid_t, lwpid_t); +static void find_thread(struct trussinfo *info, pid_t pid, lwpid_t lwpid); /* * setup_and_wait() is called to start a process. All it really does @@ -223,8 +224,10 @@ t = new_thread(p, lwps[i]); if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) err(1, "ptrace(PT_LWPINFO)"); - if (pl.pl_flags & PL_FLAG_SCE) + if (pl.pl_flags & PL_FLAG_SCE) { + find_thread(info, p->pid, pl.pl_lwpid); enter_syscall(info, t, &pl); + } } free(lwps); }