aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2010-03-10 18:21:21 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-12 18:52:32 -0500
commit5cacdb4add1b1e50fe75edc50ebbb7bddd9cf5e7 (patch)
treebd6595bb8c5c7e20ad01ed7ef766d873e5d26db3 /arch/um
parente28cbf22933d0c0ccaf3c4c27a1a263b41f73859 (diff)
Add generic sys_olduname()
Add generic implementations of the old and really old uname system calls. Note that sh only implements sys_olduname but not sys_oldolduname, but I'm not going to bother with another ifdef for that special case. m32r implemented an old uname but never wired it up, so kill it, too. Signed-off-by: Christoph Hellwig <hch@lst.de> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Jeff Dike <jdike@addtoit.com> Cc: Hirokazu Takata <takata@linux-m32r.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: James Morris <jmorris@namei.org> Cc: Andreas Schwab <schwab@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um')
-rw-r--r--arch/um/kernel/syscall.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/arch/um/kernel/syscall.c b/arch/um/kernel/syscall.c
index cccab850c27e..4393173923f5 100644
--- a/arch/um/kernel/syscall.c
+++ b/arch/um/kernel/syscall.c
@@ -51,51 +51,6 @@ long old_mmap(unsigned long addr, unsigned long len,
51 return err; 51 return err;
52} 52}
53 53
54long sys_uname(struct old_utsname __user * name)
55{
56 long err;
57 if (!name)
58 return -EFAULT;
59 down_read(&uts_sem);
60 err = copy_to_user(name, utsname(), sizeof (*name));
61 up_read(&uts_sem);
62 return err?-EFAULT:0;
63}
64
65long sys_olduname(struct oldold_utsname __user * name)
66{
67 long error;
68
69 if (!name)
70 return -EFAULT;
71 if (!access_ok(VERIFY_WRITE,name,sizeof(struct oldold_utsname)))
72 return -EFAULT;
73
74 down_read(&uts_sem);
75
76 error = __copy_to_user(&name->sysname, &utsname()->sysname,
77 __OLD_UTS_LEN);
78 error |= __put_user(0, name->sysname + __OLD_UTS_LEN);
79 error |= __copy_to_user(&name->nodename, &utsname()->nodename,
80 __OLD_UTS_LEN);
81 error |= __put_user(0, name->nodename + __OLD_UTS_LEN);
82 error |= __copy_to_user(&name->release, &utsname()->release,
83 __OLD_UTS_LEN);
84 error |= __put_user(0, name->release + __OLD_UTS_LEN);
85 error |= __copy_to_user(&name->version, &utsname()->version,
86 __OLD_UTS_LEN);
87 error |= __put_user(0, name->version + __OLD_UTS_LEN);
88 error |= __copy_to_user(&name->machine, &utsname()->machine,
89 __OLD_UTS_LEN);
90 error |= __put_user(0, name->machine + __OLD_UTS_LEN);
91
92 up_read(&uts_sem);
93
94 error = error ? -EFAULT : 0;
95
96 return error;
97}
98
99int kernel_execve(const char *filename, char *const argv[], char *const envp[]) 54int kernel_execve(const char *filename, char *const argv[], char *const envp[])
100{ 55{
101 mm_segment_t fs; 56 mm_segment_t fs;