Skip to content

Commit 80d7da1

Browse files
norovarndb
authored andcommitted
asm-generic: Drop getrlimit and setrlimit syscalls from default list
The newer prlimit64 syscall provides all the functionality of getrlimit and setrlimit syscalls and adds the pid of target process, so future architectures won't need to include getrlimit and setrlimit. Therefore drop getrlimit and setrlimit syscalls from the generic syscall list unless __ARCH_WANT_SET_GET_RLIMIT is defined by the architecture's unistd.h prior to including asm-generic/unistd.h, and adjust all architectures using the generic syscall list to define it so that no in-tree architectures are affected. Cc: Arnd Bergmann <arnd@arndb.de> Cc: linux-arch@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-hexagon@vger.kernel.org Cc: uclinux-h8-devel@lists.sourceforge.jp Signed-off-by: Yury Norov <ynorov@caviumnetworks.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mark Salter <msalter@redhat.com> [c6x] Acked-by: James Hogan <james.hogan@imgtec.com> [metag] Acked-by: Ley Foon Tan <lftan@altera.com> [nios2] Acked-by: Stafford Horne <shorne@gmail.com> [openrisc] Acked-by: Will Deacon <will.deacon@arm.com> [arm64] Acked-by: Vineet Gupta <vgupta@synopsys.com> #arch/arc bits Signed-off-by: Yury Norov <ynorov@marvell.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent 942fa98 commit 80d7da1

File tree

13 files changed

+21
-0
lines changed

13 files changed

+21
-0
lines changed

arch/arc/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#define __ARCH_WANT_RENAMEAT
2020
#define __ARCH_WANT_STAT64
21+
#define __ARCH_WANT_SET_GET_RLIMIT
2122
#define __ARCH_WANT_SYS_EXECVE
2223
#define __ARCH_WANT_SYS_CLONE
2324
#define __ARCH_WANT_SYS_VFORK

arch/arm64/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717

1818
#define __ARCH_WANT_RENAMEAT
1919
#define __ARCH_WANT_NEW_STAT
20+
#define __ARCH_WANT_SET_GET_RLIMIT
2021

2122
#include <asm-generic/unistd.h>

arch/c6x/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
#define __ARCH_WANT_RENAMEAT
1919
#define __ARCH_WANT_STAT64
20+
#define __ARCH_WANT_SET_GET_RLIMIT
2021
#define __ARCH_WANT_SYS_CLONE
2122

2223
/* Use the standard ABI for syscalls. */

arch/csky/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
33

44
#define __ARCH_WANT_SYS_CLONE
5+
#define __ARCH_WANT_SET_GET_RLIMIT
56
#include <asm-generic/unistd.h>
67

78
#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@
22

33
#define __ARCH_WANT_RENAMEAT
44
#define __ARCH_WANT_STAT64
5+
#define __ARCH_WANT_SET_GET_RLIMIT
56

67
#include <asm-generic/unistd.h>

arch/hexagon/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#define sys_mmap2 sys_mmap_pgoff
3131
#define __ARCH_WANT_RENAMEAT
3232
#define __ARCH_WANT_STAT64
33+
#define __ARCH_WANT_SET_GET_RLIMIT
3334
#define __ARCH_WANT_SYS_EXECVE
3435
#define __ARCH_WANT_SYS_CLONE
3536
#define __ARCH_WANT_SYS_VFORK

arch/nds32/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#define __ARCH_WANT_STAT64
55
#define __ARCH_WANT_SYNC_FILE_RANGE2
6+
#define __ARCH_WANT_SET_GET_RLIMIT
67

78
/* Use the standard ABI for syscalls */
89
#include <asm-generic/unistd.h>

arch/nios2/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
#define __ARCH_WANT_RENAMEAT
2222
#define __ARCH_WANT_STAT64
23+
#define __ARCH_WANT_SET_GET_RLIMIT
2324

2425
/* Use the standard ABI for syscalls */
2526
#include <asm-generic/unistd.h>

arch/openrisc/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#define __ARCH_WANT_RENAMEAT
2323
#define __ARCH_WANT_STAT64
24+
#define __ARCH_WANT_SET_GET_RLIMIT
2425
#define __ARCH_WANT_SYS_FORK
2526
#define __ARCH_WANT_SYS_CLONE
2627

arch/riscv/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#ifdef __LP64__
1919
#define __ARCH_WANT_NEW_STAT
2020
#endif /* __LP64__ */
21+
#define __ARCH_WANT_SET_GET_RLIMIT
2122

2223
#include <asm-generic/unistd.h>
2324

arch/unicore32/include/uapi/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
#define __ARCH_WANT_RENAMEAT
15+
#define __ARCH_WANT_SET_GET_RLIMIT
1516

1617
/* Use the standard ABI for syscalls. */
1718
#include <asm-generic/unistd.h>

include/uapi/asm-generic/unistd.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,15 @@ __SYSCALL(__NR_uname, sys_newuname)
467467
__SYSCALL(__NR_sethostname, sys_sethostname)
468468
#define __NR_setdomainname 162
469469
__SYSCALL(__NR_setdomainname, sys_setdomainname)
470+
471+
#ifdef __ARCH_WANT_SET_GET_RLIMIT
472+
/* getrlimit and setrlimit are superseded with prlimit64 */
470473
#define __NR_getrlimit 163
471474
__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
472475
#define __NR_setrlimit 164
473476
__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
477+
#endif
478+
474479
#define __NR_getrusage 165
475480
__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
476481
#define __NR_umask 166

scripts/checksyscalls.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ cat << EOF
3838
#define __IGNORE_lstat64 /* fstatat64 */
3939
#endif
4040
41+
#ifndef __ARCH_WANT_SET_GET_RLIMIT
42+
#define __IGNORE_getrlimit /* getrlimit */
43+
#define __IGNORE_setrlimit /* setrlimit */
44+
#endif
45+
4146
/* Missing flags argument */
4247
#define __IGNORE_renameat /* renameat2 */
4348

0 commit comments

Comments
 (0)