History

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().

Arnd Bergmann committed 8 years ago

Commit bf4b6a71 parent 82b355d10 files · +10 −1Browse files

Unified · Split

10 files
  1. arch/arc/include/uapi/asm/unistd.h +1 −0
  2. arch/c6x/include/uapi/asm/unistd.h +1 −0
  3. arch/h8300/include/uapi/asm/unistd.h +1 −0
  4. arch/hexagon/include/uapi/asm/unistd.h +1 −0
  5. arch/nds32/include/uapi/asm/unistd.h +1 −0
  6. arch/nios2/include/uapi/asm/unistd.h +1 −0
  7. arch/openrisc/include/uapi/asm/unistd.h +1 −0
  8. arch/unicore32/include/uapi/asm/unistd.h +1 −0
  9. include/asm-generic/unistd.h +0 −1
  10. include/uapi/asm-generic/unistd.h +2 −0
arch/arc/include/uapi/asm/unistd.h+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #define _UAPI_ASM_ARC_UNISTD_H
1818
1919 #define __ARCH_WANT_RENAMEAT
20+#define __ARCH_WANT_STAT64
2021 #define __ARCH_WANT_SYS_EXECVE
2122 #define __ARCH_WANT_SYS_CLONE
2223 #define __ARCH_WANT_SYS_VFORK
arch/c6x/include/uapi/asm/unistd.h+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 */
1717
1818 #define __ARCH_WANT_RENAMEAT
19+#define __ARCH_WANT_STAT64
1920 #define __ARCH_WANT_SYS_CLONE
2021
2122 /* Use the standard ABI for syscalls. */
arch/h8300/include/uapi/asm/unistd.h+1−0
@@ -1,5 +1,6 @@
11 #define __ARCH_NOMMU
22
33 #define __ARCH_WANT_RENAMEAT
4+#define __ARCH_WANT_STAT64
45
56 #include <asm-generic/unistd.h>
arch/hexagon/include/uapi/asm/unistd.h+1−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929
3030 #define sys_mmap2 sys_mmap_pgoff
3131 #define __ARCH_WANT_RENAMEAT
32+#define __ARCH_WANT_STAT64
3233 #define __ARCH_WANT_SYS_EXECVE
3334 #define __ARCH_WANT_SYS_CLONE
3435 #define __ARCH_WANT_SYS_VFORK
arch/nds32/include/uapi/asm/unistd.h+1−0
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // Copyright (C) 2005-2017 Andes Technology Corporation
33
4+#define __ARCH_WANT_STAT64
45 #define __ARCH_WANT_SYNC_FILE_RANGE2
56
67 /* Use the standard ABI for syscalls */
arch/nios2/include/uapi/asm/unistd.h+1−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #define sys_mmap2 sys_mmap_pgoff
2020
2121 #define __ARCH_WANT_RENAMEAT
22+#define __ARCH_WANT_STAT64
2223
2324 /* Use the standard ABI for syscalls */
2425 #include <asm-generic/unistd.h>
arch/openrisc/include/uapi/asm/unistd.h+1−0
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #define sys_mmap2 sys_mmap_pgoff
2121
2222 #define __ARCH_WANT_RENAMEAT
23+#define __ARCH_WANT_STAT64
2324 #define __ARCH_WANT_SYS_FORK
2425 #define __ARCH_WANT_SYS_CLONE
2526
arch/unicore32/include/uapi/asm/unistd.h+1−0
@@ -15,4 +15,5 @@ · 14 unmodified lines
1515
1616 /* Use the standard ABI for syscalls. */
1717 #include <asm-generic/unistd.h>
18+#define __ARCH_WANT_STAT64
1819 #define __ARCH_WANT_SYS_CLONE
include/asm-generic/unistd.h+0−1
@@ -8,6 +8,5 @@ · 7 unmodified lines
88 * be selected by default.
99 */
1010 #if __BITS_PER_LONG == 32
11−#define __ARCH_WANT_STAT64
1211 #define __ARCH_WANT_SYS_LLSEEK
1312 #endif
include/uapi/asm-generic/unistd.h+2−0
@@ -242,10 +242,12 @@ __SYSCALL(__NR_tee, sys_tee) · 241 unmodified lines
242242 /* fs/stat.c */
243243 #define __NR_readlinkat 78
244244 __SYSCALL(__NR_readlinkat, sys_readlinkat)
245+#if defined(__ARCH_WANT_NEW_STAT) || defined(__ARCH_WANT_STAT64)
245246 #define __NR3264_fstatat 79
246247 __SC_3264(__NR3264_fstatat, sys_fstatat64, sys_newfstatat)
247248 #define __NR3264_fstat 80
248249 __SC_3264(__NR3264_fstat, sys_fstat64, sys_newfstat)
250+#endif
249251
250252 /* fs/sync.c */
251253 #define __NR_sync 81

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t