diff options
Diffstat (limited to 'arch/um/os-Linux/util.c')
-rw-r--r-- | arch/um/os-Linux/util.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/arch/um/os-Linux/util.c b/arch/um/os-Linux/util.c index a6f31d476993..6ea77979531c 100644 --- a/arch/um/os-Linux/util.c +++ b/arch/um/os-Linux/util.c | |||
@@ -1,39 +1,24 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2000, 2001, 2002 Jeff Dike (jdike@karaya.com) | 2 | * Copyright (C) 2000 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
3 | * Licensed under the GPL | 3 | * Licensed under the GPL |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #include <stdio.h> | 6 | #include <stdio.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | ||
9 | #include <limits.h> | ||
10 | #include <sys/mman.h> | ||
11 | #include <sys/stat.h> | ||
12 | #include <sys/utsname.h> | ||
13 | #include <sys/param.h> | ||
14 | #include <sys/time.h> | ||
15 | #include "asm/types.h" | ||
16 | #include <ctype.h> | ||
17 | #include <signal.h> | ||
18 | #include <wait.h> | ||
19 | #include <errno.h> | 8 | #include <errno.h> |
20 | #include <stdarg.h> | 9 | #include <signal.h> |
21 | #include <sched.h> | ||
22 | #include <termios.h> | ||
23 | #include <string.h> | 10 | #include <string.h> |
24 | #include "kern_util.h" | 11 | #include <termios.h> |
25 | #include "user.h" | 12 | #include <wait.h> |
26 | #include "mem_user.h" | 13 | #include <sys/mman.h> |
27 | #include "init.h" | 14 | #include <sys/utsname.h> |
28 | #include "ptrace_user.h" | ||
29 | #include "uml-config.h" | ||
30 | #include "os.h" | ||
31 | #include "longjmp.h" | ||
32 | #include "kern_constants.h" | 15 | #include "kern_constants.h" |
16 | #include "os.h" | ||
17 | #include "user.h" | ||
33 | 18 | ||
34 | void stack_protections(unsigned long address) | 19 | void stack_protections(unsigned long address) |
35 | { | 20 | { |
36 | if(mprotect((void *) address, UM_THREAD_SIZE, | 21 | if (mprotect((void *) address, UM_THREAD_SIZE, |
37 | PROT_READ | PROT_WRITE | PROT_EXEC) < 0) | 22 | PROT_READ | PROT_WRITE | PROT_EXEC) < 0) |
38 | panic("protecting stack failed, errno = %d", errno); | 23 | panic("protecting stack failed, errno = %d", errno); |
39 | } | 24 | } |
@@ -44,17 +29,19 @@ int raw(int fd) | |||
44 | int err; | 29 | int err; |
45 | 30 | ||
46 | CATCH_EINTR(err = tcgetattr(fd, &tt)); | 31 | CATCH_EINTR(err = tcgetattr(fd, &tt)); |
47 | if(err < 0) | 32 | if (err < 0) |
48 | return -errno; | 33 | return -errno; |
49 | 34 | ||
50 | cfmakeraw(&tt); | 35 | cfmakeraw(&tt); |
51 | 36 | ||
52 | CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt)); | 37 | CATCH_EINTR(err = tcsetattr(fd, TCSADRAIN, &tt)); |
53 | if(err < 0) | 38 | if (err < 0) |
54 | return -errno; | 39 | return -errno; |
55 | 40 | ||
56 | /* XXX tcsetattr could have applied only some changes | 41 | /* |
57 | * (and cfmakeraw() is a set of changes) */ | 42 | * XXX tcsetattr could have applied only some changes |
43 | * (and cfmakeraw() is a set of changes) | ||
44 | */ | ||
58 | return 0; | 45 | return 0; |
59 | } | 46 | } |
60 | 47 | ||