]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
y2038: Remove stat64 family from default syscall set
authorArnd Bergmann <arnd@arndb.de>
Fri, 13 Apr 2018 10:19:47 +0000 (12:19 +0200)
committerArnd Bergmann <arnd@arndb.de>
Wed, 29 Aug 2018 13:42:20 +0000 (15:42 +0200)
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>
arch/arc/include/uapi/asm/unistd.h
arch/c6x/include/uapi/asm/unistd.h
arch/h8300/include/uapi/asm/unistd.h
arch/hexagon/include/uapi/asm/unistd.h
arch/nds32/include/uapi/asm/unistd.h
arch/nios2/include/uapi/asm/unistd.h
arch/openrisc/include/uapi/asm/unistd.h
arch/unicore32/include/uapi/asm/unistd.h
include/asm-generic/unistd.h
include/uapi/asm-generic/unistd.h

index 517178b1daef30f5c6c89fbcb3362ad38c12543f..3b3543fd151c2555677445de903346896631a4c1 100644 (file)
@@ -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
index 0d2daf7f9809c37e68c2bdb7c49cb270be1f298f..6b2fe792de9d8b2478f9279f610049f52498cea6 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #define __ARCH_WANT_RENAMEAT
+#define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_CLONE
 
 /* Use the standard ABI for syscalls. */
index 7dd20ef7625adeeba03fba80cde6aaa70d91e3c2..628195823816d712e66e06ffdef4b1097d8002c9 100644 (file)
@@ -1,5 +1,6 @@
 #define __ARCH_NOMMU
 
 #define __ARCH_WANT_RENAMEAT
+#define __ARCH_WANT_STAT64
 
 #include <asm-generic/unistd.h>
index ea181e79162e7a14051e565f40caa2d77d4657d0..c91ca7d0246128130812cf0e0a6fac5efa351c4c 100644 (file)
@@ -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
index 6e95901cabe3c9131325fd084a02c05526eec42a..603e826e04491a5167156961829e9f4ed9ff6e6d 100644 (file)
@@ -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 */
index b6bdae04bc84c118f50d7f656f5f39cf62318c32..d9948d88790b1bec9b127893b6149552b5f23135 100644 (file)
@@ -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>
index 11c5a58ab3336a548889f091ca707a67c2e93ab0..ec37df18d8edece5b743e402523e96ec023ee57a 100644 (file)
@@ -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
 
index 65856eaab163e79ef04603b087af8217306d8c18..1e8fe5941b8ab3b9a4a92cfa1489f2c4238b5a6f 100644 (file)
@@ -15,4 +15,5 @@
 
 /* Use the standard ABI for syscalls. */
 #include <asm-generic/unistd.h>
+#define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_CLONE
index cdf904265caf3913e98d865df1f7b96870a4b765..ea74eca8463f18278624d100743bb897c18aefae 100644 (file)
@@ -8,6 +8,5 @@
  * be selected by default.
  */
 #if __BITS_PER_LONG == 32
-#define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SYS_LLSEEK
 #endif
index df4bedb9b01c281b7bf15048fef3063a35ede51c..538546edbfbd2bd1cfca431aa95864f018fcc7ee 100644 (file)
@@ -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