Lines Matching defs:phdl
46 proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl)
51 memset(phdl, 0, sizeof(*phdl));
52 phdl->pid = pid;
53 phdl->flags = flags;
54 phdl->status = status;
60 len = sizeof(phdl->execname);
61 if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) {
67 phdl->execname[0] = '\0';
75 struct proc_handle *phdl;
86 if ((phdl = malloc(sizeof(struct proc_handle))) == NULL)
91 error = proc_init(pid, flags, PS_RUN, phdl);
95 if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) {
112 phdl->status = PS_STOP;
116 proc_free(phdl);
118 *pphdl = phdl;
126 struct proc_handle *phdl;
135 if ((phdl = malloc(sizeof(struct proc_handle))) == NULL)
158 error = proc_init(pid, 0, PS_IDLE, phdl);
175 phdl->status = PS_STOP;
179 proc_free(phdl);
181 *pphdl = phdl;
186 proc_free(struct proc_handle *phdl)
188 free(phdl);