aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/os-Linux/util.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2008-02-08 07:22:08 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:42 -0500
commit5134d8fea06ab51459fd095d091d1e6f73a44553 (patch)
tree504a84a9290a40f0c98b7c5731b7df82cb357ebe /arch/um/os-Linux/util.c
parent536788fe2d28e11db6aeda74207d95d750fb761f (diff)
uml: style fixes in arch/um/os-Linux
Style changes under arch/um/os-Linux: include trimming CodingStyle fixes some printks needed severity indicators make_tempfile turns out not to be used outside of mem.c, so it is now static. Its declaration in tempfile.h is no longer needed, and tempfile.h itself is no longer needed. create_tmp_file was also made static. checkpatch moans about an EXPORT_SYMBOL in user_syms.c which is part of a macro definition - this is copying a bit of kernel infrastructure into the libc side of UML because the kernel headers can't be included there. Signed-off-by: Jeff Dike <jdike@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/os-Linux/util.c')
-rw-r--r--arch/um/os-Linux/util.c43
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
34void stack_protections(unsigned long address) 19void 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