Lines Matching refs:pid
30 int is_skas_winch(int pid, int fd, void *data)
32 if (pid != getpgrp())
39 static int ptrace_dump_regs(int pid)
44 if (ptrace(PTRACE_GETREGS, pid, 0, regs) < 0)
63 void wait_stub_done(int pid)
68 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL));
75 err = ptrace(PTRACE_CONT, pid, 0, 0);
87 err = ptrace_dump_regs(pid);
92 "pid = %d, n = %d, errno = %d, status = 0x%x\n", pid, n, errno,
99 static void get_skas_faultinfo(int pid, struct faultinfo *fi)
104 err = ptrace(PTRACE_FAULTINFO, pid, 0, fi);
120 err = get_fp_registers(pid, fpregs);
126 err = ptrace(PTRACE_CONT, pid, 0, SIGSEGV);
128 printk(UM_KERN_ERR "Failed to continue stub, pid = %d, "
129 "errno = %d\n", pid, errno);
132 wait_stub_done(pid);
140 err = put_fp_registers(pid, fpregs);
149 static void handle_segv(int pid, struct uml_pt_regs * regs)
151 get_skas_faultinfo(pid, ®s->faultinfo);
159 static void handle_trap(int pid, struct uml_pt_regs *regs,
172 err = ptrace(PTRACE_POKEUSR, pid, PT_SYSCALL_NR_OFFSET,
180 err = ptrace(PTRACE_SYSCALL, pid, 0, 0);
187 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
190 err = ptrace_dump_regs(pid);
283 int pid, status, n, flags, err;
303 pid = clone(userspace_tramp, (void *) sp, flags, (void *) stub_stack);
304 if (pid < 0) {
312 CATCH_EINTR(n = waitpid(pid, &status, WUNTRACED | __WALL));
328 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL,
343 return pid;
346 os_kill_ptraced_process(pid, 1);
354 int err, status, op, pid = userspace_pid[0];
373 if (ptrace(PTRACE_SETREGS, pid, 0, regs->gp))
382 if (ptrace(op, pid, 0, 0)) {
388 CATCH_EINTR(err = waitpid(pid, &status, WUNTRACED | __WALL));
396 if (ptrace(PTRACE_GETREGS, pid, 0, regs->gp)) {
410 get_skas_faultinfo(pid,
414 else handle_segv(pid, regs);
417 handle_trap(pid, regs, local_using_sysemu);
449 pid = userspace_pid[0];
478 int copy_context_skas0(unsigned long new_stack, int pid)
498 err = ptrace_setregs(pid, thread_regs);
502 "failed, pid = %d, errno = %d\n", pid, -err);
510 * Wait, until parent has finished its work: read child's pid from
513 err = ptrace(PTRACE_CONT, pid, 0, 0);
516 printk(UM_KERN_ERR "Failed to continue new process, pid = %d, "
517 "errno = %d\n", pid, errno);
521 wait_stub_done(pid);
523 pid = data->err;
524 if (pid < 0) {
526 "error %d\n", -pid);
527 return pid;
534 wait_stub_done(pid);
542 if (ptrace(PTRACE_OLDSETOPTIONS, pid, NULL,
550 return pid;
553 os_kill_ptraced_process(pid, 1);
725 else userspace_pid[0] = mm_idp->u.pid;