Lines Matching refs:phdl
47 proc_clearflags(struct proc_handle *phdl, int mask) in proc_clearflags() argument
50 if (phdl == NULL) in proc_clearflags()
53 phdl->flags &= ~mask; in proc_clearflags()
62 proc_continue(struct proc_handle *phdl) in proc_continue() argument
66 if (phdl == NULL) in proc_continue()
69 if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP) in proc_continue()
70 pending = WSTOPSIG(phdl->wstat); in proc_continue()
73 if (ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)(uintptr_t)1, in proc_continue()
77 phdl->status = PS_RUN; in proc_continue()
83 proc_detach(struct proc_handle *phdl, int reason) in proc_detach() argument
89 if (phdl == NULL) in proc_detach()
93 if ((phdl->flags & PATTACH_RDONLY) != 0) in proc_detach()
96 pid = proc_getpid(phdl); in proc_detach()
104 proc_free(phdl); in proc_detach()
109 proc_getflags(struct proc_handle *phdl) in proc_getflags() argument
112 if (phdl == NULL) in proc_getflags()
115 return (phdl->flags); in proc_getflags()
119 proc_setflags(struct proc_handle *phdl, int mask) in proc_setflags() argument
122 if (phdl == NULL) in proc_setflags()
125 phdl->flags |= mask; in proc_setflags()
131 proc_state(struct proc_handle *phdl) in proc_state() argument
134 if (phdl == NULL) in proc_state()
137 return (phdl->status); in proc_state()
141 proc_getmodel(struct proc_handle *phdl) in proc_getmodel() argument
144 if (phdl == NULL) in proc_getmodel()
147 return (phdl->model); in proc_getmodel()
151 proc_wstatus(struct proc_handle *phdl) in proc_wstatus() argument
155 if (phdl == NULL) in proc_wstatus()
157 if (waitpid(proc_getpid(phdl), &status, WUNTRACED) < 0) { in proc_wstatus()
163 phdl->status = PS_STOP; in proc_wstatus()
165 phdl->status = PS_UNDEAD; in proc_wstatus()
166 phdl->wstat = status; in proc_wstatus()
168 return (phdl->status); in proc_wstatus()
172 proc_getwstat(struct proc_handle *phdl) in proc_getwstat() argument
175 if (phdl == NULL) in proc_getwstat()
178 return (phdl->wstat); in proc_getwstat()
191 proc_read(struct proc_handle *phdl, void *buf, size_t size, size_t addr) in proc_read() argument
195 if (phdl == NULL) in proc_read()
202 if (ptrace(PT_IO, proc_getpid(phdl), (caddr_t)&piod, 0) < 0) in proc_read()
208 proc_getlwpstatus(struct proc_handle *phdl) in proc_getlwpstatus() argument
211 lwpstatus_t *psp = &phdl->lwps; in proc_getlwpstatus()
214 if (phdl == NULL) in proc_getlwpstatus()
216 if (ptrace(PT_LWPINFO, proc_getpid(phdl), (caddr_t)&lwpinfo, in proc_getlwpstatus()