Lines Matching refs:pid
46 proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) in proc_init() argument
52 phdl->pid = pid; in proc_init()
59 mib[3] = pid; in proc_init()
63 DPRINTF("ERROR: cannot get pathname for child process %d", pid); in proc_init()
73 proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) in proc_attach() argument
79 if (pid == 0 || pid == getpid()) in proc_attach()
91 error = proc_init(pid, flags, PS_RUN, phdl); in proc_attach()
95 if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) { in proc_attach()
97 DPRINTF("ERROR: cannot ptrace child process %d", pid); in proc_attach()
102 if (waitpid(pid, &status, WUNTRACED) == -1) { in proc_attach()
104 DPRINTF("ERROR: child process %d didn't stop as expected", pid); in proc_attach()
110 DPRINTFX("ERROR: child process %d status 0x%x", pid, status); in proc_attach()
129 pid_t pid; in proc_create() local
141 if ((pid = vfork()) == -1) in proc_create()
143 else if (pid == 0) { in proc_create()
158 error = proc_init(pid, 0, PS_IDLE, phdl); in proc_create()
163 if (waitpid(pid, &status, WUNTRACED) == -1) { in proc_create()
165 DPRINTF("ERROR: child process %d didn't stop as expected", pid); in proc_create()
172 DPRINTFX("ERROR: child process %d status 0x%x", pid, status); in proc_create()