diff options
author | Christoph Hellwig <hch@lst.de> | 2010-03-10 18:21:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-12 18:52:32 -0500 |
commit | 5d0e52830e9ae09b872567f4aca3dfb5b5918079 (patch) | |
tree | 55a199575058da551ccc837ab35a1f4826a8c5b4 | |
parent | 724ee626f38feaea215a11790e1a0cb5d83b0628 (diff) |
Add generic sys_old_select()
Add a generic implementation of the old select() syscall, which expects
its argument in a memory block and switch all architectures over to use
it.
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>
Reviewed-by: 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>
Acked-by: Andreas Schwab <schwab@linux-m68k.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: David Howells <dhowells@redhat.com>
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>
27 files changed, 52 insertions, 152 deletions
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h index cf9cdaa2d4d4..e18500d305ba 100644 --- a/arch/arm/include/asm/unistd.h +++ b/arch/arm/include/asm/unistd.h | |||
@@ -443,6 +443,7 @@ | |||
443 | #define __ARCH_WANT_SYS_SIGPROCMASK | 443 | #define __ARCH_WANT_SYS_SIGPROCMASK |
444 | #define __ARCH_WANT_SYS_RT_SIGACTION | 444 | #define __ARCH_WANT_SYS_RT_SIGACTION |
445 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND | 445 | #define __ARCH_WANT_SYS_RT_SIGSUSPEND |
446 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
446 | 447 | ||
447 | #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) | 448 | #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) |
448 | #define __ARCH_WANT_SYS_TIME | 449 | #define __ARCH_WANT_SYS_TIME |
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S index 9314a2d681f1..7671e9a75449 100644 --- a/arch/arm/kernel/calls.S +++ b/arch/arm/kernel/calls.S | |||
@@ -91,7 +91,7 @@ | |||
91 | CALL(sys_settimeofday) | 91 | CALL(sys_settimeofday) |
92 | /* 80 */ CALL(sys_getgroups16) | 92 | /* 80 */ CALL(sys_getgroups16) |
93 | CALL(sys_setgroups16) | 93 | CALL(sys_setgroups16) |
94 | CALL(OBSOLETE(old_select)) /* used by libc4 */ | 94 | CALL(OBSOLETE(sys_old_select)) /* used by libc4 */ |
95 | CALL(sys_symlink) | 95 | CALL(sys_symlink) |
96 | CALL(sys_ni_syscall) /* was sys_lstat */ | 96 | CALL(sys_ni_syscall) /* was sys_lstat */ |
97 | /* 85 */ CALL(sys_readlink) | 97 | /* 85 */ CALL(sys_readlink) |
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c index ae4027bd01bd..e59cddedcbba 100644 --- a/arch/arm/kernel/sys_arm.c +++ b/arch/arm/kernel/sys_arm.c | |||
@@ -54,27 +54,6 @@ out: | |||
54 | return error; | 54 | return error; |
55 | } | 55 | } |
56 | 56 | ||
57 | /* | ||
58 | * Perform the select(nd, in, out, ex, tv) and mmap() system | ||
59 | * calls. | ||
60 | */ | ||
61 | |||
62 | struct sel_arg_struct { | ||
63 | unsigned long n; | ||
64 | fd_set __user *inp, *outp, *exp; | ||
65 | struct timeval __user *tvp; | ||
66 | }; | ||
67 | |||
68 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
69 | { | ||
70 | struct sel_arg_struct a; | ||
71 | |||
72 | if (copy_from_user(&a, arg, sizeof(a))) | ||
73 | return -EFAULT; | ||
74 | /* sys_select() does the appropriate kernel locking */ | ||
75 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
76 | } | ||
77 | |||
78 | #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) | 57 | #if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT) |
79 | /* | 58 | /* |
80 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 59 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index 99f3c3561ecb..3bea0b3eb24f 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h | |||
@@ -348,6 +348,7 @@ | |||
348 | #define __ARCH_WANT_SYS_LLSEEK | 348 | #define __ARCH_WANT_SYS_LLSEEK |
349 | #define __ARCH_WANT_SYS_NICE | 349 | #define __ARCH_WANT_SYS_NICE |
350 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 350 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
351 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
351 | #define __ARCH_WANT_SYS_OLDUMOUNT | 352 | #define __ARCH_WANT_SYS_OLDUMOUNT |
352 | #define __ARCH_WANT_SYS_SIGPENDING | 353 | #define __ARCH_WANT_SYS_SIGPENDING |
353 | #define __ARCH_WANT_SYS_SIGPROCMASK | 354 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c index b5969db0ca10..e9a3ecf90c9c 100644 --- a/arch/h8300/kernel/sys_h8300.c +++ b/arch/h8300/kernel/sys_h8300.c | |||
@@ -60,22 +60,6 @@ out: | |||
60 | return error; | 60 | return error; |
61 | } | 61 | } |
62 | 62 | ||
63 | struct sel_arg_struct { | ||
64 | unsigned long n; | ||
65 | fd_set *inp, *outp, *exp; | ||
66 | struct timeval *tvp; | ||
67 | }; | ||
68 | |||
69 | asmlinkage int old_select(struct sel_arg_struct *arg) | ||
70 | { | ||
71 | struct sel_arg_struct a; | ||
72 | |||
73 | if (copy_from_user(&a, arg, sizeof(a))) | ||
74 | return -EFAULT; | ||
75 | /* sys_select() does the appropriate kernel locking */ | ||
76 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
77 | } | ||
78 | |||
79 | /* | 63 | /* |
80 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 64 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
81 | * | 65 | * |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 2d69881eda6a..fe5ae20e60c5 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -96,7 +96,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
96 | .long SYMBOL_NAME(sys_settimeofday) | 96 | .long SYMBOL_NAME(sys_settimeofday) |
97 | .long SYMBOL_NAME(sys_getgroups16) /* 80 */ | 97 | .long SYMBOL_NAME(sys_getgroups16) /* 80 */ |
98 | .long SYMBOL_NAME(sys_setgroups16) | 98 | .long SYMBOL_NAME(sys_setgroups16) |
99 | .long SYMBOL_NAME(old_select) | 99 | .long SYMBOL_NAME(sys_old_select) |
100 | .long SYMBOL_NAME(sys_symlink) | 100 | .long SYMBOL_NAME(sys_symlink) |
101 | .long SYMBOL_NAME(sys_lstat) | 101 | .long SYMBOL_NAME(sys_lstat) |
102 | .long SYMBOL_NAME(sys_readlink) /* 85 */ | 102 | .long SYMBOL_NAME(sys_readlink) /* 85 */ |
diff --git a/arch/m68k/include/asm/unistd.h b/arch/m68k/include/asm/unistd.h index d72a71dabecb..1582c2db1c86 100644 --- a/arch/m68k/include/asm/unistd.h +++ b/arch/m68k/include/asm/unistd.h | |||
@@ -363,6 +363,7 @@ | |||
363 | #define __ARCH_WANT_SYS_LLSEEK | 363 | #define __ARCH_WANT_SYS_LLSEEK |
364 | #define __ARCH_WANT_SYS_NICE | 364 | #define __ARCH_WANT_SYS_NICE |
365 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 365 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
366 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
366 | #define __ARCH_WANT_SYS_OLDUMOUNT | 367 | #define __ARCH_WANT_SYS_OLDUMOUNT |
367 | #define __ARCH_WANT_SYS_SIGPENDING | 368 | #define __ARCH_WANT_SYS_SIGPENDING |
368 | #define __ARCH_WANT_SYS_SIGPROCMASK | 369 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index e136b8cbe9b9..09b1f09be3a6 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S | |||
@@ -510,7 +510,7 @@ sys_call_table: | |||
510 | .long sys_settimeofday | 510 | .long sys_settimeofday |
511 | .long sys_getgroups16 /* 80 */ | 511 | .long sys_getgroups16 /* 80 */ |
512 | .long sys_setgroups16 | 512 | .long sys_setgroups16 |
513 | .long old_select | 513 | .long sys_old_select |
514 | .long sys_symlink | 514 | .long sys_symlink |
515 | .long sys_lstat | 515 | .long sys_lstat |
516 | .long sys_readlink /* 85 */ | 516 | .long sys_readlink /* 85 */ |
diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index e3ad2d671973..03b58dd86c7a 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c | |||
@@ -80,22 +80,6 @@ out: | |||
80 | return error; | 80 | return error; |
81 | } | 81 | } |
82 | 82 | ||
83 | struct sel_arg_struct { | ||
84 | unsigned long n; | ||
85 | fd_set __user *inp, *outp, *exp; | ||
86 | struct timeval __user *tvp; | ||
87 | }; | ||
88 | |||
89 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
90 | { | ||
91 | struct sel_arg_struct a; | ||
92 | |||
93 | if (copy_from_user(&a, arg, sizeof(a))) | ||
94 | return -EFAULT; | ||
95 | /* sys_select() does the appropriate kernel locking */ | ||
96 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
97 | } | ||
98 | |||
99 | /* | 83 | /* |
100 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 84 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
101 | * | 85 | * |
diff --git a/arch/m68knommu/kernel/sys_m68k.c b/arch/m68knommu/kernel/sys_m68k.c index 923dd4aab875..e0d3f13e77a8 100644 --- a/arch/m68knommu/kernel/sys_m68k.c +++ b/arch/m68knommu/kernel/sys_m68k.c | |||
@@ -61,22 +61,6 @@ out: | |||
61 | return error; | 61 | return error; |
62 | } | 62 | } |
63 | 63 | ||
64 | struct sel_arg_struct { | ||
65 | unsigned long n; | ||
66 | fd_set *inp, *outp, *exp; | ||
67 | struct timeval *tvp; | ||
68 | }; | ||
69 | |||
70 | asmlinkage int old_select(struct sel_arg_struct *arg) | ||
71 | { | ||
72 | struct sel_arg_struct a; | ||
73 | |||
74 | if (copy_from_user(&a, arg, sizeof(a))) | ||
75 | return -EFAULT; | ||
76 | /* sys_select() does the appropriate kernel locking */ | ||
77 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
78 | } | ||
79 | |||
80 | /* | 64 | /* |
81 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 65 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
82 | * | 66 | * |
diff --git a/arch/m68knommu/kernel/syscalltable.S b/arch/m68knommu/kernel/syscalltable.S index 56dd01ded148..405738351700 100644 --- a/arch/m68knommu/kernel/syscalltable.S +++ b/arch/m68knommu/kernel/syscalltable.S | |||
@@ -100,7 +100,7 @@ ENTRY(sys_call_table) | |||
100 | .long sys_settimeofday | 100 | .long sys_settimeofday |
101 | .long sys_getgroups16 /* 80 */ | 101 | .long sys_getgroups16 /* 80 */ |
102 | .long sys_setgroups16 | 102 | .long sys_setgroups16 |
103 | .long old_select | 103 | .long sys_old_select |
104 | .long sys_symlink | 104 | .long sys_symlink |
105 | .long sys_lstat | 105 | .long sys_lstat |
106 | .long sys_readlink /* 85 */ | 106 | .long sys_readlink /* 85 */ |
diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index c05acb95c2a9..d13a56e99bad 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h | |||
@@ -375,6 +375,7 @@ | |||
375 | #define __ARCH_WANT_SYS_LLSEEK | 375 | #define __ARCH_WANT_SYS_LLSEEK |
376 | #define __ARCH_WANT_SYS_NICE | 376 | #define __ARCH_WANT_SYS_NICE |
377 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 377 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
378 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
378 | #define __ARCH_WANT_SYS_OLDUMOUNT | 379 | #define __ARCH_WANT_SYS_OLDUMOUNT |
379 | #define __ARCH_WANT_SYS_SIGPENDING | 380 | #define __ARCH_WANT_SYS_SIGPENDING |
380 | #define __ARCH_WANT_SYS_SIGPROCMASK | 381 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S index 88e3e1c3cc21..d9ed5a15c547 100644 --- a/arch/mn10300/kernel/entry.S +++ b/arch/mn10300/kernel/entry.S | |||
@@ -468,7 +468,7 @@ ENTRY(sys_call_table) | |||
468 | .long sys_settimeofday | 468 | .long sys_settimeofday |
469 | .long sys_getgroups16 /* 80 */ | 469 | .long sys_getgroups16 /* 80 */ |
470 | .long sys_setgroups16 | 470 | .long sys_setgroups16 |
471 | .long old_select | 471 | .long sys_old_select |
472 | .long sys_symlink | 472 | .long sys_symlink |
473 | .long sys_lstat | 473 | .long sys_lstat |
474 | .long sys_readlink /* 85 */ | 474 | .long sys_readlink /* 85 */ |
diff --git a/arch/mn10300/kernel/sys_mn10300.c b/arch/mn10300/kernel/sys_mn10300.c index 17cc6ce04e84..bef69d6daf15 100644 --- a/arch/mn10300/kernel/sys_mn10300.c +++ b/arch/mn10300/kernel/sys_mn10300.c | |||
@@ -32,24 +32,6 @@ asmlinkage long old_mmap(unsigned long addr, unsigned long len, | |||
32 | return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | 32 | return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); |
33 | } | 33 | } |
34 | 34 | ||
35 | struct sel_arg_struct { | ||
36 | unsigned long n; | ||
37 | fd_set *inp; | ||
38 | fd_set *outp; | ||
39 | fd_set *exp; | ||
40 | struct timeval *tvp; | ||
41 | }; | ||
42 | |||
43 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
44 | { | ||
45 | struct sel_arg_struct a; | ||
46 | |||
47 | if (copy_from_user(&a, arg, sizeof(a))) | ||
48 | return -EFAULT; | ||
49 | /* sys_select() does the appropriate kernel locking */ | ||
50 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
51 | } | ||
52 | |||
53 | /* | 35 | /* |
54 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 36 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
55 | * | 37 | * |
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index e1e5e767ab56..9905a0cacf93 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -28,7 +28,6 @@ struct new_utsname; | |||
28 | struct mmap_arg_struct; | 28 | struct mmap_arg_struct; |
29 | struct fadvise64_64_args; | 29 | struct fadvise64_64_args; |
30 | struct old_sigaction; | 30 | struct old_sigaction; |
31 | struct sel_arg_struct; | ||
32 | 31 | ||
33 | long sys_mmap2(struct mmap_arg_struct __user *arg); | 32 | long sys_mmap2(struct mmap_arg_struct __user *arg); |
34 | long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); | 33 | long sys_s390_old_mmap(struct mmap_arg_struct __user *arg); |
diff --git a/arch/um/sys-i386/syscalls.c b/arch/um/sys-i386/syscalls.c index 857ca0b3bdef..0e49d2a20c17 100644 --- a/arch/um/sys-i386/syscalls.c +++ b/arch/um/sys-i386/syscalls.c | |||
@@ -44,24 +44,6 @@ long old_mmap_i386(struct mmap_arg_struct __user *arg) | |||
44 | return err; | 44 | return err; |
45 | } | 45 | } |
46 | 46 | ||
47 | struct sel_arg_struct { | ||
48 | unsigned long n; | ||
49 | fd_set __user *inp; | ||
50 | fd_set __user *outp; | ||
51 | fd_set __user *exp; | ||
52 | struct timeval __user *tvp; | ||
53 | }; | ||
54 | |||
55 | long old_select(struct sel_arg_struct __user *arg) | ||
56 | { | ||
57 | struct sel_arg_struct a; | ||
58 | |||
59 | if (copy_from_user(&a, arg, sizeof(a))) | ||
60 | return -EFAULT; | ||
61 | /* sys_select() does the appropriate kernel locking */ | ||
62 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
63 | } | ||
64 | |||
65 | /* | 47 | /* |
66 | * The prototype on i386 is: | 48 | * The prototype on i386 is: |
67 | * | 49 | * |
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 53147ad85b96..34f821802c23 100644 --- a/arch/x86/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S | |||
@@ -586,7 +586,7 @@ ia32_sys_call_table: | |||
586 | .quad compat_sys_settimeofday | 586 | .quad compat_sys_settimeofday |
587 | .quad sys_getgroups16 /* 80 */ | 587 | .quad sys_getgroups16 /* 80 */ |
588 | .quad sys_setgroups16 | 588 | .quad sys_setgroups16 |
589 | .quad sys32_old_select | 589 | .quad compat_sys_old_select |
590 | .quad sys_symlink | 590 | .quad sys_symlink |
591 | .quad sys_lstat | 591 | .quad sys_lstat |
592 | .quad sys_readlink /* 85 */ | 592 | .quad sys_readlink /* 85 */ |
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 422572c77923..cb80816e7a16 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
@@ -332,24 +332,6 @@ asmlinkage long sys32_alarm(unsigned int seconds) | |||
332 | return alarm_setitimer(seconds); | 332 | return alarm_setitimer(seconds); |
333 | } | 333 | } |
334 | 334 | ||
335 | struct sel_arg_struct { | ||
336 | unsigned int n; | ||
337 | unsigned int inp; | ||
338 | unsigned int outp; | ||
339 | unsigned int exp; | ||
340 | unsigned int tvp; | ||
341 | }; | ||
342 | |||
343 | asmlinkage long sys32_old_select(struct sel_arg_struct __user *arg) | ||
344 | { | ||
345 | struct sel_arg_struct a; | ||
346 | |||
347 | if (copy_from_user(&a, arg, sizeof(a))) | ||
348 | return -EFAULT; | ||
349 | return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp), | ||
350 | compat_ptr(a.exp), compat_ptr(a.tvp)); | ||
351 | } | ||
352 | |||
353 | asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, | 335 | asmlinkage long sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, |
354 | int options) | 336 | int options) |
355 | { | 337 | { |
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h index d5f69045c100..b26fc750e416 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h | |||
@@ -40,8 +40,6 @@ asmlinkage long sys32_rt_sigprocmask(int, compat_sigset_t __user *, | |||
40 | compat_sigset_t __user *, unsigned int); | 40 | compat_sigset_t __user *, unsigned int); |
41 | asmlinkage long sys32_alarm(unsigned int); | 41 | asmlinkage long sys32_alarm(unsigned int); |
42 | 42 | ||
43 | struct sel_arg_struct; | ||
44 | asmlinkage long sys32_old_select(struct sel_arg_struct __user *); | ||
45 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int); | 43 | asmlinkage long sys32_waitpid(compat_pid_t, unsigned int *, int); |
46 | asmlinkage long sys32_sysfs(int, u32, u32); | 44 | asmlinkage long sys32_sysfs(int, u32, u32); |
47 | 45 | ||
diff --git a/arch/x86/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 8868b9420b0e..8406d06c118d 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -52,12 +52,10 @@ unsigned long sys_sigreturn(struct pt_regs *); | |||
52 | 52 | ||
53 | /* kernel/sys_i386_32.c */ | 53 | /* kernel/sys_i386_32.c */ |
54 | struct mmap_arg_struct; | 54 | struct mmap_arg_struct; |
55 | struct sel_arg_struct; | ||
56 | struct oldold_utsname; | 55 | struct oldold_utsname; |
57 | struct old_utsname; | 56 | struct old_utsname; |
58 | 57 | ||
59 | asmlinkage int old_mmap(struct mmap_arg_struct __user *); | 58 | asmlinkage int old_mmap(struct mmap_arg_struct __user *); |
60 | asmlinkage int old_select(struct sel_arg_struct __user *); | ||
61 | asmlinkage int sys_ipc(uint, int, int, int, void __user *, long); | 59 | asmlinkage int sys_ipc(uint, int, int, int, void __user *, long); |
62 | asmlinkage int sys_uname(struct old_utsname __user *); | 60 | asmlinkage int sys_uname(struct old_utsname __user *); |
63 | asmlinkage int sys_olduname(struct oldold_utsname __user *); | 61 | asmlinkage int sys_olduname(struct oldold_utsname __user *); |
diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index 3baf379fa840..4eb2667b54ae 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h | |||
@@ -366,6 +366,7 @@ | |||
366 | #define __ARCH_WANT_SYS_LLSEEK | 366 | #define __ARCH_WANT_SYS_LLSEEK |
367 | #define __ARCH_WANT_SYS_NICE | 367 | #define __ARCH_WANT_SYS_NICE |
368 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 368 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
369 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
369 | #define __ARCH_WANT_SYS_OLDUMOUNT | 370 | #define __ARCH_WANT_SYS_OLDUMOUNT |
370 | #define __ARCH_WANT_SYS_SIGPENDING | 371 | #define __ARCH_WANT_SYS_SIGPENDING |
371 | #define __ARCH_WANT_SYS_SIGPROCMASK | 372 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/x86/kernel/sys_i386_32.c b/arch/x86/kernel/sys_i386_32.c index dee1ff7cba58..345dbd19a2b3 100644 --- a/arch/x86/kernel/sys_i386_32.c +++ b/arch/x86/kernel/sys_i386_32.c | |||
@@ -58,23 +58,6 @@ out: | |||
58 | return err; | 58 | return err; |
59 | } | 59 | } |
60 | 60 | ||
61 | |||
62 | struct sel_arg_struct { | ||
63 | unsigned long n; | ||
64 | fd_set __user *inp, *outp, *exp; | ||
65 | struct timeval __user *tvp; | ||
66 | }; | ||
67 | |||
68 | asmlinkage int old_select(struct sel_arg_struct __user *arg) | ||
69 | { | ||
70 | struct sel_arg_struct a; | ||
71 | |||
72 | if (copy_from_user(&a, arg, sizeof(a))) | ||
73 | return -EFAULT; | ||
74 | /* sys_select() does the appropriate kernel locking */ | ||
75 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
76 | } | ||
77 | |||
78 | /* | 61 | /* |
79 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | 62 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. |
80 | * | 63 | * |
diff --git a/arch/x86/kernel/syscall_table_32.S b/arch/x86/kernel/syscall_table_32.S index 15228b5d3eb7..4d10abacecdb 100644 --- a/arch/x86/kernel/syscall_table_32.S +++ b/arch/x86/kernel/syscall_table_32.S | |||
@@ -81,7 +81,7 @@ ENTRY(sys_call_table) | |||
81 | .long sys_settimeofday | 81 | .long sys_settimeofday |
82 | .long sys_getgroups16 /* 80 */ | 82 | .long sys_getgroups16 /* 80 */ |
83 | .long sys_setgroups16 | 83 | .long sys_setgroups16 |
84 | .long old_select | 84 | .long sys_old_select |
85 | .long sys_symlink | 85 | .long sys_symlink |
86 | .long sys_lstat | 86 | .long sys_lstat |
87 | .long sys_readlink /* 85 */ | 87 | .long sys_readlink /* 85 */ |
diff --git a/fs/compat.c b/fs/compat.c index 00d90c2e66f0..030602d453b7 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1795,6 +1795,24 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
1795 | return ret; | 1795 | return ret; |
1796 | } | 1796 | } |
1797 | 1797 | ||
1798 | struct compat_sel_arg_struct { | ||
1799 | compat_ulong_t n; | ||
1800 | compat_uptr_t inp; | ||
1801 | compat_uptr_t outp; | ||
1802 | compat_uptr_t exp; | ||
1803 | compat_uptr_t tvp; | ||
1804 | }; | ||
1805 | |||
1806 | asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg) | ||
1807 | { | ||
1808 | struct compat_sel_arg_struct a; | ||
1809 | |||
1810 | if (copy_from_user(&a, arg, sizeof(a))) | ||
1811 | return -EFAULT; | ||
1812 | return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp), | ||
1813 | compat_ptr(a.exp), compat_ptr(a.tvp)); | ||
1814 | } | ||
1815 | |||
1798 | #ifdef HAVE_SET_RESTORE_SIGMASK | 1816 | #ifdef HAVE_SET_RESTORE_SIGMASK |
1799 | static long do_compat_pselect(int n, compat_ulong_t __user *inp, | 1817 | static long do_compat_pselect(int n, compat_ulong_t __user *inp, |
1800 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 1818 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
diff --git a/fs/select.c b/fs/select.c index 73715e90030f..500a669f7790 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -691,6 +691,23 @@ SYSCALL_DEFINE6(pselect6, int, n, fd_set __user *, inp, fd_set __user *, outp, | |||
691 | } | 691 | } |
692 | #endif /* HAVE_SET_RESTORE_SIGMASK */ | 692 | #endif /* HAVE_SET_RESTORE_SIGMASK */ |
693 | 693 | ||
694 | #ifdef __ARCH_WANT_SYS_OLD_SELECT | ||
695 | struct sel_arg_struct { | ||
696 | unsigned long n; | ||
697 | fd_set __user *inp, *outp, *exp; | ||
698 | struct timeval __user *tvp; | ||
699 | }; | ||
700 | |||
701 | SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg) | ||
702 | { | ||
703 | struct sel_arg_struct a; | ||
704 | |||
705 | if (copy_from_user(&a, arg, sizeof(a))) | ||
706 | return -EFAULT; | ||
707 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
708 | } | ||
709 | #endif | ||
710 | |||
694 | struct poll_list { | 711 | struct poll_list { |
695 | struct poll_list *next; | 712 | struct poll_list *next; |
696 | int len; | 713 | int len; |
diff --git a/include/linux/compat.h b/include/linux/compat.h index ef68119a4fd2..717c691ecd8e 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -23,6 +23,7 @@ | |||
23 | typedef __compat_uid32_t compat_uid_t; | 23 | typedef __compat_uid32_t compat_uid_t; |
24 | typedef __compat_gid32_t compat_gid_t; | 24 | typedef __compat_gid32_t compat_gid_t; |
25 | 25 | ||
26 | struct compat_sel_arg_struct; | ||
26 | struct rusage; | 27 | struct rusage; |
27 | 28 | ||
28 | struct compat_itimerspec { | 29 | struct compat_itimerspec { |
@@ -249,6 +250,8 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, | |||
249 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 250 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
250 | struct compat_timeval __user *tvp); | 251 | struct compat_timeval __user *tvp); |
251 | 252 | ||
253 | asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg); | ||
254 | |||
252 | asmlinkage long compat_sys_wait4(compat_pid_t pid, | 255 | asmlinkage long compat_sys_wait4(compat_pid_t pid, |
253 | compat_uint_t __user *stat_addr, int options, | 256 | compat_uint_t __user *stat_addr, int options, |
254 | struct compat_rusage __user *ru); | 257 | struct compat_rusage __user *ru); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 8126f239edf0..85a9f21fe11a 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -34,6 +34,7 @@ struct pollfd; | |||
34 | struct rlimit; | 34 | struct rlimit; |
35 | struct rusage; | 35 | struct rusage; |
36 | struct sched_param; | 36 | struct sched_param; |
37 | struct sel_arg_struct; | ||
37 | struct semaphore; | 38 | struct semaphore; |
38 | struct sembuf; | 39 | struct sembuf; |
39 | struct shmid_ds; | 40 | struct shmid_ds; |
@@ -638,6 +639,7 @@ asmlinkage long sys_poll(struct pollfd __user *ufds, unsigned int nfds, | |||
638 | long timeout); | 639 | long timeout); |
639 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, | 640 | asmlinkage long sys_select(int n, fd_set __user *inp, fd_set __user *outp, |
640 | fd_set __user *exp, struct timeval __user *tvp); | 641 | fd_set __user *exp, struct timeval __user *tvp); |
642 | asmlinkage long sys_old_select(struct sel_arg_struct __user *arg); | ||
641 | asmlinkage long sys_epoll_create(int size); | 643 | asmlinkage long sys_epoll_create(int size); |
642 | asmlinkage long sys_epoll_create1(int flags); | 644 | asmlinkage long sys_epoll_create1(int flags); |
643 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, | 645 | asmlinkage long sys_epoll_ctl(int epfd, int op, int fd, |