diff options
Diffstat (limited to 'arch/um/kernel/syscall.c')
-rw-r--r-- | arch/um/kernel/syscall.c | 73 |
1 files changed, 2 insertions, 71 deletions
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c index a4625c7b2bf9..4393173923f5 100644 --- a/arch/um/kernel/syscall.c +++ b/arch/um/kernel/syscall.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include "linux/mm.h" | 8 | #include "linux/mm.h" |
9 | #include "linux/sched.h" | 9 | #include "linux/sched.h" |
10 | #include "linux/utsname.h" | 10 | #include "linux/utsname.h" |
11 | #include "linux/syscalls.h" | ||
11 | #include "asm/current.h" | 12 | #include "asm/current.h" |
12 | #include "asm/mman.h" | 13 | #include "asm/mman.h" |
13 | #include "asm/uaccess.h" | 14 | #include "asm/uaccess.h" |
@@ -37,31 +38,6 @@ long sys_vfork(void) | |||
37 | return ret; | 38 | return ret; |
38 | } | 39 | } |
39 | 40 | ||
40 | /* common code for old and new mmaps */ | ||
41 | long sys_mmap2(unsigned long addr, unsigned long len, | ||
42 | unsigned long prot, unsigned long flags, | ||
43 | unsigned long fd, unsigned long pgoff) | ||
44 | { | ||
45 | long error = -EBADF; | ||
46 | struct file * file = NULL; | ||
47 | |||
48 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
49 | if (!(flags & MAP_ANONYMOUS)) { | ||
50 | file = fget(fd); | ||
51 | if (!file) | ||
52 | goto out; | ||
53 | } | ||
54 | |||
55 | down_write(¤t->mm->mmap_sem); | ||
56 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
57 | up_write(¤t->mm->mmap_sem); | ||
58 | |||
59 | if (file) | ||
60 | fput(file); | ||
61 | out: | ||
62 | return error; | ||
63 | } | ||
64 | |||
65 | long old_mmap(unsigned long addr, unsigned long len, | 41 | long old_mmap(unsigned long addr, unsigned long len, |
66 | unsigned long prot, unsigned long flags, | 42 | unsigned long prot, unsigned long flags, |
67 | unsigned long fd, unsigned long offset) | 43 | unsigned long fd, unsigned long offset) |
@@ -70,56 +46,11 @@ long old_mmap(unsigned long addr, unsigned long len, | |||
70 | if (offset & ~PAGE_MASK) | 46 | if (offset & ~PAGE_MASK) |
71 | goto out; | 47 | goto out; |
72 | 48 | ||
73 | err = sys_mmap2(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | 49 | err = sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); |
74 | out: | 50 | out: |
75 | return err; | 51 | return err; |
76 | } | 52 | } |
77 | 53 | ||
78 | long sys_uname(struct old_utsname __user * name) | ||
79 | { | ||
80 | long err; | ||
81 | if (!name) | ||
82 | return -EFAULT; | ||
83 | down_read(&uts_sem); | ||
84 | err = copy_to_user(name, utsname(), sizeof (*name)); | ||
85 | up_read(&uts_sem); | ||
86 | return err?-EFAULT:0; | ||
87 | } | ||
88 | |||
89 | long sys_olduname(struct oldold_utsname __user * name) | ||
90 | { | ||
91 | long error; | ||
92 | |||
93 | if (!name) | ||
94 | return -EFAULT; | ||
95 | if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname))) | ||
96 | return -EFAULT; | ||
97 | |||
98 | down_read(&uts_sem); | ||
99 | |||
100 | error = __copy_to_user(&name->sysname, &utsname()->sysname, | ||
101 | __OLD_UTS_LEN); | ||
102 | error |= __put_user(0, name->sysname + __OLD_UTS_LEN); | ||
103 | error |= __copy_to_user(&name->nodename, &utsname()->nodename, | ||
104 | __OLD_UTS_LEN); | ||
105 | error |= __put_user(0, name->nodename + __OLD_UTS_LEN); | ||
106 | error |= __copy_to_user(&name->release, &utsname()->release, | ||
107 | __OLD_UTS_LEN); | ||
108 | error |= __put_user(0, name->release + __OLD_UTS_LEN); | ||
109 | error |= __copy_to_user(&name->version, &utsname()->version, | ||
110 | __OLD_UTS_LEN); | ||
111 | error |= __put_user(0, name->version + __OLD_UTS_LEN); | ||
112 | error |= __copy_to_user(&name->machine, &utsname()->machine, | ||
113 | __OLD_UTS_LEN); | ||
114 | error |= __put_user(0, name->machine + __OLD_UTS_LEN); | ||
115 | |||
116 | up_read(&uts_sem); | ||
117 | |||
118 | error = error ? -EFAULT : 0; | ||
119 | |||
120 | return error; | ||
121 | } | ||
122 | |||
123 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) | 54 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]) |
124 | { | 55 | { |
125 | mm_segment_t fs; | 56 | mm_segment_t fs; |