Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

y2038: Remove stat64 family from default syscall set

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 <arnd@arndb.de>

+10 -1
+1
arch/arc/include/uapi/asm/unistd.h
··· 17 17 #define _UAPI_ASM_ARC_UNISTD_H 18 18 19 19 #define __ARCH_WANT_RENAMEAT 20 + #define __ARCH_WANT_STAT64 20 21 #define __ARCH_WANT_SYS_EXECVE 21 22 #define __ARCH_WANT_SYS_CLONE 22 23 #define __ARCH_WANT_SYS_VFORK
+1
arch/c6x/include/uapi/asm/unistd.h
··· 16 16 */ 17 17 18 18 #define __ARCH_WANT_RENAMEAT 19 + #define __ARCH_WANT_STAT64 19 20 #define __ARCH_WANT_SYS_CLONE 20 21 21 22 /* Use the standard ABI for syscalls. */
+1
arch/h8300/include/uapi/asm/unistd.h
··· 1 1 #define __ARCH_NOMMU 2 2 3 3 #define __ARCH_WANT_RENAMEAT 4 + #define __ARCH_WANT_STAT64 4 5 5 6 #include <asm-generic/unistd.h>
+1
arch/hexagon/include/uapi/asm/unistd.h
··· 29 29 30 30 #define sys_mmap2 sys_mmap_pgoff 31 31 #define __ARCH_WANT_RENAMEAT 32 + #define __ARCH_WANT_STAT64 32 33 #define __ARCH_WANT_SYS_EXECVE 33 34 #define __ARCH_WANT_SYS_CLONE 34 35 #define __ARCH_WANT_SYS_VFORK
+1
arch/nds32/include/uapi/asm/unistd.h
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 // Copyright (C) 2005-2017 Andes Technology Corporation 3 3 4 + #define __ARCH_WANT_STAT64 4 5 #define __ARCH_WANT_SYNC_FILE_RANGE2 5 6 6 7 /* Use the standard ABI for syscalls */
+1
arch/nios2/include/uapi/asm/unistd.h
··· 19 19 #define sys_mmap2 sys_mmap_pgoff 20 20 21 21 #define __ARCH_WANT_RENAMEAT 22 + #define __ARCH_WANT_STAT64 22 23 23 24 /* Use the standard ABI for syscalls */ 24 25 #include <asm-generic/unistd.h>
+1
arch/openrisc/include/uapi/asm/unistd.h
··· 20 20 #define sys_mmap2 sys_mmap_pgoff 21 21 22 22 #define __ARCH_WANT_RENAMEAT 23 + #define __ARCH_WANT_STAT64 23 24 #define __ARCH_WANT_SYS_FORK 24 25 #define __ARCH_WANT_SYS_CLONE 25 26
+1
arch/unicore32/include/uapi/asm/unistd.h
··· 15 15 16 16 /* Use the standard ABI for syscalls. */ 17 17 #include <asm-generic/unistd.h> 18 + #define __ARCH_WANT_STAT64 18 19 #define __ARCH_WANT_SYS_CLONE
-1
include/asm-generic/unistd.h
··· 8 8 * be selected by default. 9 9 */ 10 10 #if __BITS_PER_LONG == 32 11 - #define __ARCH_WANT_STAT64 12 11 #define __ARCH_WANT_SYS_LLSEEK 13 12 #endif
+2
include/uapi/asm-generic/unistd.h
··· 242 242 /* fs/stat.c */ 243 243 #define __NR_readlinkat 78 244 244 __SYSCALL(__NR_readlinkat, sys_readlinkat) 245 + #if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64) 245 246 #define __NR3264_fstatat 79 246 247 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat) 247 248 #define __NR3264_fstat 80 248 249 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat) 250 + #endif 249 251 250 252 /* fs/sync.c */ 251 253 #define __NR_sync 81