Lines Matching refs:phdl
46 proc_clearflags(struct proc_handle *phdl, int mask) in proc_clearflags() argument
49 if (phdl == NULL) in proc_clearflags()
52 phdl->flags &= ~mask; in proc_clearflags()
61 proc_continue(struct proc_handle *phdl) in proc_continue() argument
65 if (phdl == NULL) in proc_continue()
68 if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) in proc_continue()
69 pending = WSTOPSIG(phdl->wstat); in proc_continue()
72 if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1, in proc_continue()
76 phdl->status = PS_RUN; in proc_continue()
82 proc_detach(struct proc_handle *phdl, int reason) in proc_detach() argument
88 if (phdl == NULL) in proc_detach()
92 if ((phdl->flags & PATTACH_RDONLY) != 0) in proc_detach()
95 pid = proc_getpid(phdl); in proc_detach()
103 proc_free(phdl); in proc_detach()
108 proc_getflags(struct proc_handle *phdl) in proc_getflags() argument
111 if (phdl == NULL) in proc_getflags()
114 return (phdl->flags); in proc_getflags()
118 proc_setflags(struct proc_handle *phdl, int mask) in proc_setflags() argument
121 if (phdl == NULL) in proc_setflags()
124 phdl->flags |= mask; in proc_setflags()
130 proc_state(struct proc_handle *phdl) in proc_state() argument
133 if (phdl == NULL) in proc_state()
136 return (phdl->status); in proc_state()
140 proc_getmodel(struct proc_handle *phdl) in proc_getmodel() argument
143 if (phdl == NULL) in proc_getmodel()
146 return (phdl->model); in proc_getmodel()
150 proc_wstatus(struct proc_handle *phdl) in proc_wstatus() argument
154 if (phdl == NULL) in proc_wstatus()
156 if (waitpid(proc_getpid(phdl), &status, WUNTRACED) < 0) { in proc_wstatus()
162 phdl->status = PS_STOP; in proc_wstatus()
164 phdl->status = PS_UNDEAD; in proc_wstatus()
165 phdl->wstat = status; in proc_wstatus()
167 return (phdl->status); in proc_wstatus()
171 proc_getwstat(struct proc_handle *phdl) in proc_getwstat() argument
174 if (phdl == NULL) in proc_getwstat()
177 return (phdl->wstat); in proc_getwstat()
190 proc_read(struct proc_handle *phdl, void *buf, size_t size, size_t addr) in proc_read() argument
194 if (phdl == NULL) in proc_read()
201 if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) in proc_read()
207 proc_getlwpstatus(struct proc_handle *phdl) in proc_getlwpstatus() argument
210 lwpstatus_t *psp = &phdl->lwps; in proc_getlwpstatus()
213 if (phdl == NULL) in proc_getlwpstatus()
215 if (ptrace(PT_LWPINFO, proc_getpid(phdl), (caddr_t)&lwpinfo, in proc_getlwpstatus()