Lines Matching defs:pid

78 	pid_t pid;
80 pid = vfork();
81 if (pid == -1)
83 if (pid == 0) { /* Child */
90 if (waitpid(pid, NULL, 0) < 0)
93 new_proc(info, pid, 0);
100 start_tracing(struct trussinfo *info, pid_t pid)
106 ret = ptrace(PT_ATTACH, pid, NULL, 0);
112 if (waitpid(pid, NULL, 0) < 0)
115 new_proc(info, pid, 0);
132 detach_proc(pid_t pid)
136 kill(pid, SIGSTOP);
137 if (waitpid(pid, NULL, 0) < 0)
140 if (ptrace(PT_DETACH, pid, (caddr_t)1, 0) < 0)
143 kill(pid, SIGCONT);
151 find_abi(pid_t pid)
163 mib[3] = pid;
172 warnx("ABI %s for pid %ld is not supported", progt, (long)pid);
215 nlwps = ptrace(PT_GETNUMLWPS, p->pid, NULL, 0);
220 nlwps = ptrace(PT_GETLWPLIST, p->pid, (caddr_t)lwps, nlwps);
236 new_proc(struct trussinfo *info, pid_t pid, lwpid_t lwpid)
245 if (np->pid == pid)
246 errx(1, "Duplicate process for pid %ld", (long)pid);
250 if (ptrace(PT_FOLLOW_FORK, pid, NULL, 1) == -1)
251 err(1, "Unable to follow forks for pid %ld", (long)pid);
252 if (ptrace(PT_LWP_EVENTS, pid, NULL, 1) == -1)
253 err(1, "Unable to enable LWP events for pid %ld", (long)pid);
255 np->pid = pid;
256 np->abi = find_abi(pid);
284 detach_proc(p->pid);
290 find_proc(struct trussinfo *info, pid_t pid)
295 if (np->pid == pid)
303 * Change curthread member based on (pid, lwpid).
306 find_thread(struct trussinfo *info, pid_t pid, lwpid_t lwpid)
311 np = find_proc(info, pid);
328 find_exit_thread(struct trussinfo *info, pid_t pid)
332 p = find_proc(info, pid);
494 p->abi = find_abi(p->pid);
496 if (ptrace(PT_DETACH, p->pid, (caddr_t)1, 0) < 0)
514 len += fprintf(info->outfile, "%5d", t->proc->pid);
606 fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid,
633 fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid,