Skip to content

Commit 5d0e528

Browse files
Christoph Hellwigtorvalds
authored andcommitted
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>
1 parent 724ee62 commit 5d0e528

27 files changed

Lines changed: 52 additions & 152 deletions

File tree

‎arch/arm/include/asm/unistd.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,7 @@
443443
#define __ARCH_WANT_SYS_SIGPROCMASK
444444
#define __ARCH_WANT_SYS_RT_SIGACTION
445445
#define __ARCH_WANT_SYS_RT_SIGSUSPEND
446+
#define __ARCH_WANT_SYS_OLD_SELECT
446447

447448
#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
448449
#define __ARCH_WANT_SYS_TIME

‎arch/arm/kernel/calls.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
CALL(sys_settimeofday)
9292
/* 80 */ CALL(sys_getgroups16)
9393
CALL(sys_setgroups16)
94-
CALL(OBSOLETE(old_select)) /* used by libc4 */
94+
CALL(OBSOLETE(sys_old_select)) /* used by libc4 */
9595
CALL(sys_symlink)
9696
CALL(sys_ni_syscall) /* was sys_lstat */
9797
/* 85 */ CALL(sys_readlink)

‎arch/arm/kernel/sys_arm.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -54,27 +54,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
5454
return error;
5555
}
5656

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-
7857
#if !defined(CONFIG_AEABI) || defined(CONFIG_OABI_COMPAT)
7958
/*
8059
* sys_ipc() is the de-multiplexer for the SysV IPC calls..

‎arch/h8300/include/asm/unistd.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@
348348
#define __ARCH_WANT_SYS_LLSEEK
349349
#define __ARCH_WANT_SYS_NICE
350350
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
351+
#define __ARCH_WANT_SYS_OLD_SELECT
351352
#define __ARCH_WANT_SYS_OLDUMOUNT
352353
#define __ARCH_WANT_SYS_SIGPENDING
353354
#define __ARCH_WANT_SYS_SIGPROCMASK

‎arch/h8300/kernel/sys_h8300.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct *arg)
6060
return error;
6161
}
6262

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-
7963
/*
8064
* sys_ipc() is the de-multiplexer for the SysV IPC calls..
8165
*

‎arch/h8300/kernel/syscalls.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ SYMBOL_NAME_LABEL(sys_call_table)
9696
.long SYMBOL_NAME(sys_settimeofday)
9797
.long SYMBOL_NAME(sys_getgroups16) /* 80 */
9898
.long SYMBOL_NAME(sys_setgroups16)
99-
.long SYMBOL_NAME(old_select)
99+
.long SYMBOL_NAME(sys_old_select)
100100
.long SYMBOL_NAME(sys_symlink)
101101
.long SYMBOL_NAME(sys_lstat)
102102
.long SYMBOL_NAME(sys_readlink) /* 85 */

‎arch/m68k/include/asm/unistd.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
#define __ARCH_WANT_SYS_LLSEEK
364364
#define __ARCH_WANT_SYS_NICE
365365
#define __ARCH_WANT_SYS_OLD_GETRLIMIT
366+
#define __ARCH_WANT_SYS_OLD_SELECT
366367
#define __ARCH_WANT_SYS_OLDUMOUNT
367368
#define __ARCH_WANT_SYS_SIGPENDING
368369
#define __ARCH_WANT_SYS_SIGPROCMASK

‎arch/m68k/kernel/entry.S‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ sys_call_table:
510510
.long sys_settimeofday
511511
.long sys_getgroups16 /* 80 */
512512
.long sys_setgroups16
513-
.long old_select
513+
.long sys_old_select
514514
.long sys_symlink
515515
.long sys_lstat
516516
.long sys_readlink /* 85 */

‎arch/m68k/kernel/sys_m68k.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,22 +80,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct __user *arg)
8080
return error;
8181
}
8282

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-
9983
/*
10084
* sys_ipc() is the de-multiplexer for the SysV IPC calls..
10185
*

‎arch/m68knommu/kernel/sys_m68k.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -61,22 +61,6 @@ asmlinkage int old_mmap(struct mmap_arg_struct *arg)
6161
return error;
6262
}
6363

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-
8064
/*
8165
* sys_ipc() is the de-multiplexer for the SysV IPC calls..
8266
*

0 commit comments

Comments
 (0)