Lines Matching refs:phdl
44 proc_clearflags(struct proc_handle *phdl, int mask)
47 if (phdl == NULL)
50 phdl->flags &= ~mask;
59 proc_continue(struct proc_handle *phdl)
63 if (phdl == NULL)
66 if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP)
67 pending = WSTOPSIG(phdl->wstat);
68 if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0)
71 phdl->status = PS_RUN;
77 proc_detach(struct proc_handle *phdl, int reason)
81 if (phdl == NULL)
84 kill(phdl->pid, SIGKILL);
87 if (ptrace(PT_DETACH, phdl->pid, 0, 0) != 0 && errno == ESRCH)
90 kill(phdl->pid, SIGSTOP);
91 waitpid(phdl->pid, &status, WUNTRACED);
92 ptrace(PT_DETACH, phdl->pid, 0, 0);
93 kill(phdl->pid, SIGCONT);
101 proc_getflags(struct proc_handle *phdl)
104 if (phdl == NULL)
107 return(phdl->flags);
111 proc_setflags(struct proc_handle *phdl, int mask)
114 if (phdl == NULL)
117 phdl->flags |= mask;
123 proc_state(struct proc_handle *phdl)
126 if (phdl == NULL)
129 return (phdl->status);
133 proc_getpid(struct proc_handle *phdl)
136 if (phdl == NULL)
139 return (phdl->pid);
143 proc_wstatus(struct proc_handle *phdl)
147 if (phdl == NULL)
149 if (waitpid(phdl->pid, &status, WUNTRACED) < 0) {
155 phdl->status = PS_STOP;
157 phdl->status = PS_UNDEAD;
158 phdl->wstat = status;
160 return (phdl->status);
164 proc_getwstat(struct proc_handle *phdl)
167 if (phdl == NULL)
170 return (phdl->wstat);
183 proc_read(struct proc_handle *phdl, void *buf, size_t size, size_t addr)
187 if (phdl == NULL)
194 if (ptrace(PT_IO, phdl->pid, (caddr_t)&piod, 0) < 0)
200 proc_getlwpstatus(struct proc_handle *phdl)
203 lwpstatus_t *psp = &phdl->lwps;
206 if (phdl == NULL)
208 if (ptrace(PT_LWPINFO, phdl->pid, (caddr_t)&lwpinfo,