Lines Matching refs:phdl

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