diff options
author | Gennady Sharapov <Gennady.V.Sharapov@intel.com> | 2006-01-18 20:42:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-18 22:20:19 -0500 |
commit | 4fef0c10fa174b57a10854b8b4b2b90d155706e0 (patch) | |
tree | 02cfcc989114da9a6d46484753937cc0e3a60b52 /arch/um/os-Linux/tt.c | |
parent | 12919aa6e015dd85170fc3b1a3e10a5dfd116c72 (diff) |
[PATCH] uml: move libc-dependent utility procedures
The serial UML OS-abstraction layer patch (um/kernel dir).
This moves all systemcalls from user_util.c file under os-Linux dir
Signed-off-by: Gennady Sharapov <Gennady.V.Sharapov@intel.com>
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/os-Linux/tt.c')
-rw-r--r-- | arch/um/os-Linux/tt.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/um/os-Linux/tt.c b/arch/um/os-Linux/tt.c index cb2648b79d0f..404bb63a74a9 100644 --- a/arch/um/os-Linux/tt.c +++ b/arch/um/os-Linux/tt.c | |||
@@ -63,6 +63,54 @@ void kill_child_dead(int pid) | |||
63 | } while(1); | 63 | } while(1); |
64 | } | 64 | } |
65 | 65 | ||
66 | void stop(void) | ||
67 | { | ||
68 | while(1) sleep(1000000); | ||
69 | } | ||
70 | |||
71 | int wait_for_stop(int pid, int sig, int cont_type, void *relay) | ||
72 | { | ||
73 | sigset_t *relay_signals = relay; | ||
74 | int status, ret; | ||
75 | |||
76 | while(1){ | ||
77 | CATCH_EINTR(ret = waitpid(pid, &status, WUNTRACED)); | ||
78 | if((ret < 0) || | ||
79 | !WIFSTOPPED(status) || (WSTOPSIG(status) != sig)){ | ||
80 | if(ret < 0){ | ||
81 | printk("wait failed, errno = %d\n", | ||
82 | errno); | ||
83 | } | ||
84 | else if(WIFEXITED(status)) | ||
85 | printk("process %d exited with status %d\n", | ||
86 | pid, WEXITSTATUS(status)); | ||
87 | else if(WIFSIGNALED(status)) | ||
88 | printk("process %d exited with signal %d\n", | ||
89 | pid, WTERMSIG(status)); | ||
90 | else if((WSTOPSIG(status) == SIGVTALRM) || | ||
91 | (WSTOPSIG(status) == SIGALRM) || | ||
92 | (WSTOPSIG(status) == SIGIO) || | ||
93 | (WSTOPSIG(status) == SIGPROF) || | ||
94 | (WSTOPSIG(status) == SIGCHLD) || | ||
95 | (WSTOPSIG(status) == SIGWINCH) || | ||
96 | (WSTOPSIG(status) == SIGINT)){ | ||
97 | ptrace(cont_type, pid, 0, WSTOPSIG(status)); | ||
98 | continue; | ||
99 | } | ||
100 | else if((relay_signals != NULL) && | ||
101 | sigismember(relay_signals, WSTOPSIG(status))){ | ||
102 | ptrace(cont_type, pid, 0, WSTOPSIG(status)); | ||
103 | continue; | ||
104 | } | ||
105 | else printk("process %d stopped with signal %d\n", | ||
106 | pid, WSTOPSIG(status)); | ||
107 | panic("wait_for_stop failed to wait for %d to stop " | ||
108 | "with %d\n", pid, sig); | ||
109 | } | ||
110 | return(status); | ||
111 | } | ||
112 | } | ||
113 | |||
66 | /* | 114 | /* |
67 | *------------------------- | 115 | *------------------------- |
68 | * only for tt mode (will be deleted in future...) | 116 | * only for tt mode (will be deleted in future...) |