Lines Matching defs:phdl

45 proc_clearflags(struct proc_handle *phdl, int mask)
48 if (phdl == NULL)
51 phdl->flags &= ~mask;
60 proc_continue(struct proc_handle *phdl)
64 if (phdl == NULL)
67 if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP)
68 pending = WSTOPSIG(phdl->wstat);
69 if (ptrace(PT_CONTINUE, phdl->pid, (void *)(uintptr_t)1, pending) != 0)
72 phdl->status = PS_RUN;
78 proc_detach(struct proc_handle *phdl, int reason)
82 if (phdl == NULL)
85 ptrace(PT_DETACH, phdl->pid, (void *)(uintptr_t)1, 0);
86 kill(phdl->pid, SIGKILL);
89 if (ptrace(PT_DETACH, phdl->pid, (void *)(uintptr_t)1, 0) == 0)
101 if (kill(phdl->pid, SIGSTOP) == -1)
104 waitpid(phdl->pid, &status, WUNTRACED);
106 if (ptrace(PT_DETACH, phdl->pid, (void *)(uintptr_t)1, 0) == -1)
109 if (kill(phdl->pid, SIGCONT) == -1)
116 proc_getflags(struct proc_handle *phdl)
119 if (phdl == NULL)
122 return(phdl->flags);
126 proc_setflags(struct proc_handle *phdl, int mask)
129 if (phdl == NULL)
132 phdl->flags |= mask;
138 proc_state(struct proc_handle *phdl)
141 if (phdl == NULL)
144 return (phdl->status);
148 proc_getmodel(struct proc_handle *phdl)
151 if (phdl == NULL)
154 return (phdl->model);
158 proc_getpid(struct proc_handle *phdl)
161 if (phdl == NULL)
164 return (phdl->pid);
168 proc_wstatus(struct proc_handle *phdl)
172 if (phdl == NULL)
174 if (waitpid(phdl->pid, &status, WUNTRACED) < 0) {
180 phdl->status = PS_STOP;
182 phdl->status = PS_UNDEAD;
183 phdl->wstat = status;
185 return (phdl->status);
189 proc_getwstat(struct proc_handle *phdl)
192 if (phdl == NULL)
195 return (phdl->wstat);
208 proc_read(struct proc_handle *phdl, void *buf, size_t size, size_t addr)
212 if (phdl == NULL)
219 if (ptrace(PT_IO, phdl->pid, (void *)&piod, 0) < 0)
225 proc_getlwpstatus(struct proc_handle *phdl)
227 lwpstatus_t *psp = &phdl->lwps;
233 if (ptrace(PT_GET_SIGINFO, phdl->pid, (void *)&si,
257 if (phdl == NULL)
261 if (ptrace(PT_LWPINFO, phdl->pid, (void *)&lwpinfo,