From 5a105f19b5aae79dd302899e634b6b18b3dcd0d6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 30 Jan 2020 11:25:07 -0500 Subject: remove legacy clock_gettime and gettimeofday from public syscall.h some nontrivial number of applications have historically performed direct syscalls for these operations rather than using the public functions. such usage is invalid now that time_t is 64-bit and these syscalls no longer match the types they are used with, and it was already harmful before (by suppressing use of vdso). since syscall() has no type safety, incorrect usage of these syscalls can't be caught at compile-time. so, without manually inspecting or running additional tools to check sources, the risk of such errors slipping through is high. this patch renames the syscalls on 32-bit archs to clock_gettime32 and gettimeofday_time32, so that applications using the original names will fail to build without being fixed. note that there are a number of other syscalls that may also be unsafe to use directly after the time64 switchover, but (1) these are the main two that seem to be in widespread use, and (2) most of the others continue to have valid usage with a null timeval/timespec argument, as the argument is an optional timeout or similar. --- arch/mipsn32/bits/syscall.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/mipsn32') diff --git a/arch/mipsn32/bits/syscall.h.in b/arch/mipsn32/bits/syscall.h.in index 134a4f81..d13fda12 100644 --- a/arch/mipsn32/bits/syscall.h.in +++ b/arch/mipsn32/bits/syscall.h.in @@ -92,7 +92,7 @@ #define __NR_fchown 6091 #define __NR_lchown 6092 #define __NR_umask 6093 -#define __NR_gettimeofday 6094 +#define __NR_gettimeofday_time32 6094 #define __NR_getrlimit 6095 #define __NR_getrusage 6096 #define __NR_sysinfo 6097 @@ -224,7 +224,7 @@ #define __NR_timer_getoverrun 6223 #define __NR_timer_delete 6224 #define __NR_clock_settime 6225 -#define __NR_clock_gettime 6226 +#define __NR_clock_gettime32 6226 #define __NR_clock_getres 6227 #define __NR_clock_nanosleep 6228 #define __NR_tgkill 6229 -- cgit v1.2.1