aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel/tt/ptproxy/wait.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/kernel/tt/ptproxy/wait.c')
-rw-r--r--arch/um/kernel/tt/ptproxy/wait.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/arch/um/kernel/tt/ptproxy/wait.c b/arch/um/kernel/tt/ptproxy/wait.c
deleted file mode 100644
index bdd4af4b65fc..000000000000
--- a/arch/um/kernel/tt/ptproxy/wait.c
+++ /dev/null
@@ -1,85 +0,0 @@
1/**********************************************************************
2wait.c
3
4Copyright (C) 1999 Lars Brinkhoff. See the file COPYING for licensing
5terms and conditions.
6
7**********************************************************************/
8
9#include <errno.h>
10#include <signal.h>
11#include <sys/wait.h>
12
13#include "ptproxy.h"
14#include "sysdep.h"
15#include "wait.h"
16#include "ptrace_user.h"
17#include "sysdep/ptrace.h"
18#include "sysdep/sigcontext.h"
19
20int proxy_wait_return(struct debugger *debugger, pid_t unused)
21{
22 debugger->waiting = 0;
23
24 if(debugger->debugee->died || (debugger->wait_options & __WCLONE)){
25 debugger_cancelled_return(debugger, -ECHILD);
26 return(0);
27 }
28
29 if(debugger->debugee->zombie && debugger->debugee->event)
30 debugger->debugee->died = 1;
31
32 if(debugger->debugee->event){
33 debugger->debugee->event = 0;
34 ptrace(PTRACE_POKEDATA, debugger->pid,
35 debugger->wait_status_ptr,
36 debugger->debugee->wait_status);
37 /* if (wait4)
38 ptrace (PTRACE_POKEDATA, pid, rusage_ptr, ...); */
39 debugger_cancelled_return(debugger, debugger->debugee->pid);
40 return(0);
41 }
42
43 /* pause will return -EINTR, which happens to be right for wait */
44 debugger_normal_return(debugger, -1);
45 return(0);
46}
47
48int parent_wait_return(struct debugger *debugger, pid_t unused)
49{
50 return(debugger_normal_return(debugger, -1));
51}
52
53int real_wait_return(struct debugger *debugger)
54{
55 unsigned long ip;
56 int pid;
57
58 pid = debugger->pid;
59
60 ip = ptrace(PTRACE_PEEKUSR, pid, PT_IP_OFFSET, 0);
61 IP_RESTART_SYSCALL(ip);
62
63 if(ptrace(PTRACE_POKEUSR, pid, PT_IP_OFFSET, ip) < 0)
64 tracer_panic("real_wait_return : Failed to restart system "
65 "call, errno = %d\n", errno);
66
67 if((ptrace(PTRACE_SYSCALL, debugger->pid, 0, SIGCHLD) < 0) ||
68 (ptrace(PTRACE_SYSCALL, debugger->pid, 0, 0) < 0) ||
69 (ptrace(PTRACE_SYSCALL, debugger->pid, 0, 0) < 0) ||
70 debugger_normal_return(debugger, -1))
71 tracer_panic("real_wait_return : gdb failed to wait, "
72 "errno = %d\n", errno);
73 return(0);
74}
75
76/*
77 * Overrides for Emacs so that we follow Linus's tabbing style.
78 * Emacs will notice this stuff at the end of the file and automatically
79 * adjust the settings for this buffer only. This must remain at the end
80 * of the file.
81 * ---------------------------------------------------------------------------
82 * Local variables:
83 * c-file-style: "linux"
84 * End:
85 */