| Jeff Dike | 8e36706 | 2006-03-27 01:14:32 -0800 | [diff] [blame] | 1 | /* | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) | 
|  | 3 | * Licensed under the GPL | 
|  | 4 | */ | 
|  | 5 |  | 
|  | 6 | #include <unistd.h> | 
|  | 7 | #include <stdlib.h> | 
|  | 8 | #include <termios.h> | 
|  | 9 | #include <pty.h> | 
|  | 10 | #include <signal.h> | 
|  | 11 | #include <errno.h> | 
|  | 12 | #include <string.h> | 
|  | 13 | #include <sched.h> | 
|  | 14 | #include <sys/socket.h> | 
|  | 15 | #include <sys/poll.h> | 
|  | 16 | #include "init.h" | 
|  | 17 | #include "user.h" | 
|  | 18 | #include "kern_util.h" | 
|  | 19 | #include "user_util.h" | 
|  | 20 | #include "sigio.h" | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | #include "os.h" | 
|  | 22 |  | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 23 | /* Protected by sigio_lock(), also used by sigio_cleanup, which is an | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | * exitcall. | 
|  | 25 | */ | 
|  | 26 | static int write_sigio_pid = -1; | 
|  | 27 |  | 
|  | 28 | /* These arrays are initialized before the sigio thread is started, and | 
|  | 29 | * the descriptors closed after it is killed.  So, it can't see them change. | 
|  | 30 | * On the UML side, they are changed under the sigio_lock. | 
|  | 31 | */ | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 32 | #define SIGIO_FDS_INIT {-1, -1} | 
|  | 33 |  | 
|  | 34 | static int write_sigio_fds[2] = SIGIO_FDS_INIT; | 
|  | 35 | static int sigio_private[2] = SIGIO_FDS_INIT; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 |  | 
|  | 37 | struct pollfds { | 
|  | 38 | struct pollfd *poll; | 
|  | 39 | int size; | 
|  | 40 | int used; | 
|  | 41 | }; | 
|  | 42 |  | 
|  | 43 | /* Protected by sigio_lock().  Used by the sigio thread, but the UML thread | 
|  | 44 | * synchronizes with it. | 
|  | 45 | */ | 
| Jeff Dike | 29ac1c2 | 2006-07-10 04:45:12 -0700 | [diff] [blame] | 46 | static struct pollfds current_poll = { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 47 | .poll  		= NULL, | 
|  | 48 | .size 		= 0, | 
|  | 49 | .used 		= 0 | 
|  | 50 | }; | 
|  | 51 |  | 
| Jeff Dike | 29ac1c2 | 2006-07-10 04:45:12 -0700 | [diff] [blame] | 52 | static struct pollfds next_poll = { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | .poll  		= NULL, | 
|  | 54 | .size 		= 0, | 
|  | 55 | .used 		= 0 | 
|  | 56 | }; | 
|  | 57 |  | 
|  | 58 | static int write_sigio_thread(void *unused) | 
|  | 59 | { | 
|  | 60 | struct pollfds *fds, tmp; | 
|  | 61 | struct pollfd *p; | 
|  | 62 | int i, n, respond_fd; | 
|  | 63 | char c; | 
|  | 64 |  | 
| Jeff Dike | cd2ee4a | 2005-05-05 16:15:32 -0700 | [diff] [blame] | 65 | signal(SIGWINCH, SIG_IGN); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 66 | fds = ¤t_poll; | 
|  | 67 | while(1){ | 
|  | 68 | n = poll(fds->poll, fds->used, -1); | 
|  | 69 | if(n < 0){ | 
|  | 70 | if(errno == EINTR) continue; | 
|  | 71 | printk("write_sigio_thread : poll returned %d, " | 
|  | 72 | "errno = %d\n", n, errno); | 
|  | 73 | } | 
|  | 74 | for(i = 0; i < fds->used; i++){ | 
|  | 75 | p = &fds->poll[i]; | 
|  | 76 | if(p->revents == 0) continue; | 
|  | 77 | if(p->fd == sigio_private[1]){ | 
|  | 78 | n = os_read_file(sigio_private[1], &c, sizeof(c)); | 
|  | 79 | if(n != sizeof(c)) | 
|  | 80 | printk("write_sigio_thread : " | 
|  | 81 | "read failed, err = %d\n", -n); | 
|  | 82 | tmp = current_poll; | 
|  | 83 | current_poll = next_poll; | 
|  | 84 | next_poll = tmp; | 
|  | 85 | respond_fd = sigio_private[1]; | 
|  | 86 | } | 
|  | 87 | else { | 
|  | 88 | respond_fd = write_sigio_fds[1]; | 
|  | 89 | fds->used--; | 
|  | 90 | memmove(&fds->poll[i], &fds->poll[i + 1], | 
|  | 91 | (fds->used - i) * sizeof(*fds->poll)); | 
|  | 92 | } | 
|  | 93 |  | 
|  | 94 | n = os_write_file(respond_fd, &c, sizeof(c)); | 
|  | 95 | if(n != sizeof(c)) | 
|  | 96 | printk("write_sigio_thread : write failed, " | 
|  | 97 | "err = %d\n", -n); | 
|  | 98 | } | 
|  | 99 | } | 
| Jeff Dike | 1b57e9c | 2006-01-06 00:18:49 -0800 | [diff] [blame] | 100 |  | 
|  | 101 | return 0; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 102 | } | 
|  | 103 |  | 
|  | 104 | static int need_poll(int n) | 
|  | 105 | { | 
|  | 106 | if(n <= next_poll.size){ | 
|  | 107 | next_poll.used = n; | 
|  | 108 | return(0); | 
|  | 109 | } | 
| Jesper Juhl | b2325fe | 2005-11-07 01:01:35 -0800 | [diff] [blame] | 110 | kfree(next_poll.poll); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 111 | next_poll.poll = um_kmalloc_atomic(n * sizeof(struct pollfd)); | 
|  | 112 | if(next_poll.poll == NULL){ | 
|  | 113 | printk("need_poll : failed to allocate new pollfds\n"); | 
|  | 114 | next_poll.size = 0; | 
|  | 115 | next_poll.used = 0; | 
|  | 116 | return(-1); | 
|  | 117 | } | 
|  | 118 | next_poll.size = n; | 
|  | 119 | next_poll.used = n; | 
|  | 120 | return(0); | 
|  | 121 | } | 
|  | 122 |  | 
|  | 123 | /* Must be called with sigio_lock held, because it's needed by the marked | 
|  | 124 | * critical section. */ | 
|  | 125 | static void update_thread(void) | 
|  | 126 | { | 
|  | 127 | unsigned long flags; | 
|  | 128 | int n; | 
|  | 129 | char c; | 
|  | 130 |  | 
|  | 131 | flags = set_signals(0); | 
|  | 132 | n = os_write_file(sigio_private[0], &c, sizeof(c)); | 
|  | 133 | if(n != sizeof(c)){ | 
|  | 134 | printk("update_thread : write failed, err = %d\n", -n); | 
|  | 135 | goto fail; | 
|  | 136 | } | 
|  | 137 |  | 
|  | 138 | n = os_read_file(sigio_private[0], &c, sizeof(c)); | 
|  | 139 | if(n != sizeof(c)){ | 
|  | 140 | printk("update_thread : read failed, err = %d\n", -n); | 
|  | 141 | goto fail; | 
|  | 142 | } | 
|  | 143 |  | 
|  | 144 | set_signals(flags); | 
|  | 145 | return; | 
|  | 146 | fail: | 
|  | 147 | /* Critical section start */ | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 148 | if(write_sigio_pid != -1) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 149 | os_kill_process(write_sigio_pid, 1); | 
|  | 150 | write_sigio_pid = -1; | 
| Jeff Dike | 8e36706 | 2006-03-27 01:14:32 -0800 | [diff] [blame] | 151 | close(sigio_private[0]); | 
|  | 152 | close(sigio_private[1]); | 
|  | 153 | close(write_sigio_fds[0]); | 
|  | 154 | close(write_sigio_fds[1]); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 155 | /* Critical section end */ | 
|  | 156 | set_signals(flags); | 
|  | 157 | } | 
|  | 158 |  | 
| Jeff Dike | 29ac1c2 | 2006-07-10 04:45:12 -0700 | [diff] [blame] | 159 | static int add_sigio_fd(int fd, int read) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 160 | { | 
|  | 161 | int err = 0, i, n, events; | 
|  | 162 |  | 
|  | 163 | sigio_lock(); | 
|  | 164 | for(i = 0; i < current_poll.used; i++){ | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 165 | if(current_poll.poll[i].fd == fd) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 166 | goto out; | 
|  | 167 | } | 
|  | 168 |  | 
|  | 169 | n = current_poll.used + 1; | 
|  | 170 | err = need_poll(n); | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 171 | if(err) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | goto out; | 
|  | 173 |  | 
|  | 174 | for(i = 0; i < current_poll.used; i++) | 
|  | 175 | next_poll.poll[i] = current_poll.poll[i]; | 
|  | 176 |  | 
|  | 177 | if(read) events = POLLIN; | 
|  | 178 | else events = POLLOUT; | 
|  | 179 |  | 
|  | 180 | next_poll.poll[n - 1] = ((struct pollfd) { .fd  	= fd, | 
|  | 181 | .events 	= events, | 
|  | 182 | .revents 	= 0 }); | 
|  | 183 | update_thread(); | 
|  | 184 | out: | 
|  | 185 | sigio_unlock(); | 
|  | 186 | return(err); | 
|  | 187 | } | 
|  | 188 |  | 
|  | 189 | int ignore_sigio_fd(int fd) | 
|  | 190 | { | 
|  | 191 | struct pollfd *p; | 
|  | 192 | int err = 0, i, n = 0; | 
|  | 193 |  | 
| Jeff Dike | 61232f2 | 2006-07-10 04:45:11 -0700 | [diff] [blame] | 194 | /* This is called from exitcalls elsewhere in UML - if | 
|  | 195 | * sigio_cleanup has already run, then update_thread will hang | 
|  | 196 | * or fail because the thread is no longer running. | 
|  | 197 | */ | 
|  | 198 | if(write_sigio_pid == -1) | 
|  | 199 | return -EIO; | 
|  | 200 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | sigio_lock(); | 
|  | 202 | for(i = 0; i < current_poll.used; i++){ | 
|  | 203 | if(current_poll.poll[i].fd == fd) break; | 
|  | 204 | } | 
|  | 205 | if(i == current_poll.used) | 
|  | 206 | goto out; | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 207 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 208 | err = need_poll(current_poll.used - 1); | 
|  | 209 | if(err) | 
|  | 210 | goto out; | 
|  | 211 |  | 
|  | 212 | for(i = 0; i < current_poll.used; i++){ | 
|  | 213 | p = ¤t_poll.poll[i]; | 
|  | 214 | if(p->fd != fd) next_poll.poll[n++] = current_poll.poll[i]; | 
|  | 215 | } | 
|  | 216 | if(n == i){ | 
|  | 217 | printk("ignore_sigio_fd : fd %d not found\n", fd); | 
|  | 218 | err = -1; | 
|  | 219 | goto out; | 
|  | 220 | } | 
|  | 221 |  | 
|  | 222 | update_thread(); | 
|  | 223 | out: | 
|  | 224 | sigio_unlock(); | 
| Jeff Dike | 61232f2 | 2006-07-10 04:45:11 -0700 | [diff] [blame] | 225 | return err; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 226 | } | 
|  | 227 |  | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 228 | static struct pollfd *setup_initial_poll(int fd) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 229 | { | 
|  | 230 | struct pollfd *p; | 
|  | 231 |  | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 232 | p = um_kmalloc(sizeof(struct pollfd)); | 
|  | 233 | if (p == NULL) { | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 234 | printk("setup_initial_poll : failed to allocate poll\n"); | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 235 | return NULL; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 236 | } | 
|  | 237 | *p = ((struct pollfd) { .fd  	= fd, | 
|  | 238 | .events 	= POLLIN, | 
|  | 239 | .revents 	= 0 }); | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 240 | return p; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 241 | } | 
|  | 242 |  | 
| Jeff Dike | 8e64d96a | 2006-07-10 04:45:11 -0700 | [diff] [blame] | 243 | static void write_sigio_workaround(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 244 | { | 
|  | 245 | unsigned long stack; | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 246 | struct pollfd *p; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | int err; | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 248 | int l_write_sigio_fds[2]; | 
|  | 249 | int l_sigio_private[2]; | 
|  | 250 | int l_write_sigio_pid; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 251 |  | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 252 | /* We call this *tons* of times - and most ones we must just fail. */ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | sigio_lock(); | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 254 | l_write_sigio_pid = write_sigio_pid; | 
|  | 255 | sigio_unlock(); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 |  | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 257 | if (l_write_sigio_pid != -1) | 
|  | 258 | return; | 
|  | 259 |  | 
|  | 260 | err = os_pipe(l_write_sigio_fds, 1, 1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 261 | if(err < 0){ | 
|  | 262 | printk("write_sigio_workaround - os_pipe 1 failed, " | 
|  | 263 | "err = %d\n", -err); | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 264 | return; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | } | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 266 | err = os_pipe(l_sigio_private, 1, 1); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | if(err < 0){ | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 268 | printk("write_sigio_workaround - os_pipe 2 failed, " | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | "err = %d\n", -err); | 
|  | 270 | goto out_close1; | 
|  | 271 | } | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 272 |  | 
|  | 273 | p = setup_initial_poll(l_sigio_private[1]); | 
|  | 274 | if(!p) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | goto out_close2; | 
|  | 276 |  | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 277 | sigio_lock(); | 
|  | 278 |  | 
|  | 279 | /* Did we race? Don't try to optimize this, please, it's not so likely | 
|  | 280 | * to happen, and no more than once at the boot. */ | 
|  | 281 | if(write_sigio_pid != -1) | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 282 | goto out_free; | 
|  | 283 |  | 
|  | 284 | current_poll = ((struct pollfds) { .poll 	= p, | 
|  | 285 | .used 	= 1, | 
|  | 286 | .size 	= 1 }); | 
|  | 287 |  | 
|  | 288 | if (write_sigio_irq(l_write_sigio_fds[0])) | 
|  | 289 | goto out_clear_poll; | 
|  | 290 |  | 
|  | 291 | memcpy(write_sigio_fds, l_write_sigio_fds, sizeof(l_write_sigio_fds)); | 
|  | 292 | memcpy(sigio_private, l_sigio_private, sizeof(l_sigio_private)); | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 293 |  | 
|  | 294 | write_sigio_pid = run_helper_thread(write_sigio_thread, NULL, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | CLONE_FILES | CLONE_VM, &stack, 0); | 
|  | 296 |  | 
| Paolo 'Blaisorblade' Giarrusso | b6a2b13 | 2006-01-18 17:42:57 -0800 | [diff] [blame] | 297 | if (write_sigio_pid < 0) | 
|  | 298 | goto out_clear; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 299 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 300 | sigio_unlock(); | 
|  | 301 | return; | 
|  | 302 |  | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 303 | out_clear: | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 304 | write_sigio_pid = -1; | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 305 | write_sigio_fds[0] = -1; | 
|  | 306 | write_sigio_fds[1] = -1; | 
|  | 307 | sigio_private[0] = -1; | 
|  | 308 | sigio_private[1] = -1; | 
|  | 309 | out_clear_poll: | 
|  | 310 | current_poll = ((struct pollfds) { .poll	= NULL, | 
|  | 311 | .size	= 0, | 
|  | 312 | .used	= 0 }); | 
|  | 313 | out_free: | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 314 | sigio_unlock(); | 
| Paolo 'Blaisorblade' Giarrusso | e6fb54a | 2006-04-10 22:53:36 -0700 | [diff] [blame] | 315 | kfree(p); | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 316 | out_close2: | 
| Jeff Dike | 8e36706 | 2006-03-27 01:14:32 -0800 | [diff] [blame] | 317 | close(l_sigio_private[0]); | 
|  | 318 | close(l_sigio_private[1]); | 
| Jeff Dike | 5f4e8fd | 2006-03-27 01:14:40 -0800 | [diff] [blame] | 319 | out_close1: | 
| Jeff Dike | 8e36706 | 2006-03-27 01:14:32 -0800 | [diff] [blame] | 320 | close(l_write_sigio_fds[0]); | 
|  | 321 | close(l_write_sigio_fds[1]); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 322 | } | 
|  | 323 |  | 
| Jeff Dike | 8e64d96a | 2006-07-10 04:45:11 -0700 | [diff] [blame] | 324 | void maybe_sigio_broken(int fd, int read) | 
|  | 325 | { | 
|  | 326 | if(!isatty(fd)) | 
|  | 327 | return; | 
|  | 328 |  | 
|  | 329 | if((read || pty_output_sigio) && (!read || pty_close_sigio)) | 
|  | 330 | return; | 
|  | 331 |  | 
|  | 332 | write_sigio_workaround(); | 
|  | 333 | add_sigio_fd(fd, read); | 
|  | 334 | } | 
|  | 335 |  | 
| Jeff Dike | 29ac1c2 | 2006-07-10 04:45:12 -0700 | [diff] [blame] | 336 | static void sigio_cleanup(void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | { | 
| Jeff Dike | f206aab | 2006-03-27 01:14:33 -0800 | [diff] [blame] | 338 | if(write_sigio_pid != -1){ | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 339 | os_kill_process(write_sigio_pid, 1); | 
|  | 340 | write_sigio_pid = -1; | 
|  | 341 | } | 
|  | 342 | } | 
| Jeff Dike | 29ac1c2 | 2006-07-10 04:45:12 -0700 | [diff] [blame] | 343 |  | 
|  | 344 | __uml_exitcall(sigio_cleanup); |