Skip to content

Commit

Permalink
y2038: Remove stat64 family from default syscall set
Browse files Browse the repository at this point in the history
New architectures should no longer need stat64, which is not y2038
safe and has been replaced by statx(). This removes the 'select
__ARCH_WANT_STAT64' statement from asm-generic/unistd.h and instead
moves it into the respective asm/unistd.h UAPI header files for each
architecture that uses it today.

In the generic file, the system call number and entry points are now
made conditional, so newly added architectures (e.g. riscv32 or csky)
will never need to carry backwards compatiblity for it.

arm64 is the only 64-bit architecture using the asm-generic/unistd.h
file, and it already sets __ARCH_WANT_NEW_STAT in its headers, and I
use the same #ifdef here: future 64-bit architectures therefore won't
see newstat or stat64 any more. They don't suffer from the y2038 time_t
overflow, but for consistency it seems best to also let them use statx().

Signed-off-by: Arnd Bergmann <[email protected]>
  • Loading branch information
arndb committed Aug 29, 2018
1 parent 82b355d commit bf4b6a7
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 1 deletion.
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 @@ -17,6 +17,7 @@
#define _UAPI_ASM_ARC_UNISTD_H

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_EXECVE
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_VFORK
Expand Down
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 @@ -16,6 +16,7 @@
*/

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_CLONE

/* Use the standard ABI for syscalls. */
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
@@ -1,5 +1,6 @@
#define __ARCH_NOMMU

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64

#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 @@ -29,6 +29,7 @@

#define sys_mmap2 sys_mmap_pgoff
#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64
#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
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0
// Copyright (C) 2005-2017 Andes Technology Corporation

#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYNC_FILE_RANGE2

/* Use the standard ABI for syscalls */
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 @@ -19,6 +19,7 @@
#define sys_mmap2 sys_mmap_pgoff

#define __ARCH_WANT_RENAMEAT
#define __ARCH_WANT_STAT64

/* 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 @@ -20,6 +20,7 @@
#define sys_mmap2 sys_mmap_pgoff

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

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 @@ -15,4 +15,5 @@

/* Use the standard ABI for syscalls. */
#include <asm-generic/unistd.h>
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_CLONE
1 change: 0 additions & 1 deletion include/asm-generic/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
* be selected by default.
*/
#if __BITS_PER_LONG == 32
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_LLSEEK
#endif
2 changes: 2 additions & 0 deletions include/uapi/asm-generic/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,12 @@ __SYSCALL(__NR_tee, sys_tee)
/* fs/stat.c */
#define __NR_readlinkat 78
__SYSCALL(__NR_readlinkat, sys_readlinkat)
#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
#define __NR3264_fstatat 79
__SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
#define __NR3264_fstat 80
__SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
#endif

/* fs/sync.c */
#define __NR_sync 81
Expand Down

0 comments on commit bf4b6a7

Please sign in to comment.