Skip to content

Commit

Permalink
asm-generic: Drop getrlimit and setrlimit syscalls from default list
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Yury Norov <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Acked-by: Mark Salter <[email protected]> [c6x]
Acked-by: James Hogan <[email protected]> [metag]
Acked-by: Ley Foon Tan <[email protected]> [nios2]
Acked-by: Stafford Horne <[email protected]> [openrisc]
Acked-by: Will Deacon <[email protected]> [arm64]
Acked-by: Vineet Gupta <[email protected]> #arch/arc bits
Signed-off-by: Yury Norov <[email protected]>
Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
norov authored and arndb committed Feb 19, 2019
1 parent 942fa98 commit 80d7da1
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_SET_GET_RLIMIT

#include <asm-generic/unistd.h>
1 change: 1 addition & 0 deletions arch/c6x/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_SYS_CLONE

/* Use the standard ABI for syscalls. */
Expand Down
1 change: 1 addition & 0 deletions arch/csky/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.

#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SET_GET_RLIMIT
#include <asm-generic/unistd.h>

#define __NR_set_thread_area (__NR_arch_specific_syscall + 0)
Expand Down
1 change: 1 addition & 0 deletions arch/h8300/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT

#include <asm-generic/unistd.h>
1 change: 1 addition & 0 deletions arch/hexagon/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define sys_mmap2 sys_mmap_pgoff
#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK
Expand Down
1 change: 1 addition & 0 deletions arch/nds32/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYNC_FILE_RANGE2
#define __ARCH_WANT_SET_GET_RLIMIT

/* Use the standard ABI for syscalls */
#include <asm-generic/unistd.h>
Expand Down
1 change: 1 addition & 0 deletions arch/nios2/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT

/* Use the standard ABI for syscalls */
#include <asm-generic/unistd.h>
Expand Down
1 change: 1 addition & 0 deletions arch/openrisc/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE

Expand Down
1 change: 1 addition & 0 deletions arch/riscv/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#ifdef __LP64__
#define __ARCH_WANT_NEW_STAT
#endif /* __LP64__ */
#define __ARCH_WANT_SET_GET_RLIMIT

#include <asm-generic/unistd.h>

Expand Down
1 change: 1 addition & 0 deletions arch/unicore32/include/uapi/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_SET_GET_RLIMIT

/* Use the standard ABI for syscalls. */
#include <asm-generic/unistd.h>
Expand Down
5 changes: 5 additions & 0 deletions include/uapi/asm-generic/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,15 @@ __SYSCALL(__NR_uname, sys_newuname)
__SYSCALL(__NR_sethostname, sys_sethostname)
#define __NR_setdomainname 162
__SYSCALL(__NR_setdomainname, sys_setdomainname)

#ifdef __ARCH_WANT_SET_GET_RLIMIT
/* getrlimit and setrlimit are superseded with prlimit64 */
#define __NR_getrlimit 163
__SC_COMP(__NR_getrlimit, sys_getrlimit, compat_sys_getrlimit)
#define __NR_setrlimit 164
__SC_COMP(__NR_setrlimit, sys_setrlimit, compat_sys_setrlimit)
#endif

#define __NR_getrusage 165
__SC_COMP(__NR_getrusage, sys_getrusage, compat_sys_getrusage)
#define __NR_umask 166
Expand Down
5 changes: 5 additions & 0 deletions scripts/checksyscalls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ cat << EOF
#define __IGNORE_lstat64 /* fstatat64 */
#endif
#ifndef __ARCH_WANT_SET_GET_RLIMIT
#define __IGNORE_getrlimit /* getrlimit */
#define __IGNORE_setrlimit /* setrlimit */
#endif
/* Missing flags argument */
#define __IGNORE_renameat /* renameat2 */
Expand Down

0 comments on commit 80d7da1

Please sign in to comment.