diff options
author | Zack Weinberg <zackw@panix.com> | 2019-08-19 14:18:08 -0400 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2019-10-30 17:03:42 -0300 |
commit | 04da832e16a7ba9999ff320869b3d8e623cd8a61 (patch) | |
tree | 1e292635107bc080f97c148cb3288c8b49588f5b /sysdeps/unix/sysv/linux/alpha/syscalls.list | |
parent | 8dddf0bd5a3d57fba8da27e93f3d1a7032fce184 (diff) | |
download | glibc-04da832e16a7ba9999ff320869b3d8e623cd8a61.tar.gz |
Linux/Alpha: don't use timeval32 system calls.
Linux/Alpha has two versions of several system call wrappers that take
or return data of type "struct timeval" (possibly nested inside a
larger structure). The GLIBC_2.0 version is a compat symbol that
calls __NR_osf_foo or __NR_old_foo and uses a struct timeval with a
32-bit tv_sec field. The GLIBC_2.1 version is used for current code,
calls __NR_foo, and uses a struct timeval with a 64-bit tv_sec field.
This patch changes all of the compat symbols of this type to be
wrappers around their GLIBC_2.1 counterparts; the compatibility system
calls will no longer be used. It serves as a proposal for part of how
we do the transition to 64-bit time_t on systems that currently use
32-bit time_t:
* The patched glibc will NOT use system calls that involve 32-bit
time_t to implement its compatibility symbols. This will make both
our lives and the kernel maintainers' lives easier. The primary
argument I've seen against it is that the kernel could warn about
uses of the old system calls, helping people find old binaries that
need to be recompiled. I think there are several other ways we
could accomplish this, e.g. scripts to scan the filesystem for
binaries with references to the old symbol versions, or issuing
diagnostics ourselves.
* The compat symbols do NOT report failure after the Y2038 deadline.
An earlier revision of this patch had them return -1 and set errno
to EOVERFLOW, but Adhemerval pointed out that many of them have
already performed side effects at the point where we discover the
overflow, so that would break more than it fixes. Also, we don't
want people to be _checking_ for EOVERFLOW from these functions; we
want them to recompile with 64-bit time_t. So it's not actually
useful for them to report failure to the calling code.
* What they do do, when they encounter overflow, is saturate the
overflowed "struct timeval"(s): tv_sec is set to INT32_MAX and
tv_nsec is set to 999999. That means time stops advancing for
programs with 32-bit time_t when they reach the deadline. That's
obviously going to break stuff, but I think wrapping around is
probably going to break _more_ stuff. I'd be interested to hear
arguments against, if anyone has one.
The new header file tv32-compat.h is currently Alpha-specific but I
mean for it to be reused to aid in writing wrappers for all affected
architectures. I only put it in sysdeps/unix/sysv/linux/alpha for now
because I haven't checked whether the various "foo32" structures it
defines agree with the ABI for ports other than Linux/Alpha.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/unix/sysv/linux/alpha/syscalls.list')
-rw-r--r-- | sysdeps/unix/sysv/linux/alpha/syscalls.list | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/syscalls.list b/sysdeps/unix/sysv/linux/alpha/syscalls.list index 12cd021b60..c786aa751e 100644 --- a/sysdeps/unix/sysv/linux/alpha/syscalls.list +++ b/sysdeps/unix/sysv/linux/alpha/syscalls.list @@ -1,4 +1,4 @@ -# File name Caller Syscall name # args Strong name Weak names +# File name Caller Syscall name Args Strong name Weak names sigstack - sigstack 2 sigstack @@ -22,23 +22,14 @@ pciconfig_read EXTRA pciconfig_read 5 pciconfig_read pciconfig_write EXTRA pciconfig_write 5 pciconfig_write pciconfig_iobase EXTRA pciconfig_iobase 3 __pciconfig_iobase pciconfig_iobase -# support old timeval32 entry points -osf_gettimeofday - osf_gettimeofday 2 __gettimeofday_tv32 __gettimeofday@GLIBC_2.0 gettimeofday@GLIBC_2.0 -osf_settimeofday - osf_settimeofday 2 __settimeofday_tv32 settimeofday@GLIBC_2.0 -osf_getitimer - osf_getitimer 2 __getitimer_tv32 getitimer@GLIBC_2.0 -osf_setitimer - osf_setitimer 3 __setitimer_tv32 setitimer@GLIBC_2.0 -osf_utimes - osf_utimes 2 __utimes_tv32 utimes@GLIBC_2.0 -osf_getrusage - osf_getrusage 2 __getrusage_tv32 getrusage@GLIBC_2.0 -osf_wait4 - osf_wait4 4 __wait4_tv32 wait4@GLIBC_2.0 - -# support new timeval64 entry points -gettimeofday - gettimeofday 2 __GI___gettimeofday gettimeofday@@GLIBC_2.1 __gettimeofday@@GLIBC_2.1 -settimeofday - settimeofday 2 __settimeofday settimeofday@@GLIBC_2.1 -getitimer - getitimer 2 __getitimer getitimer@@GLIBC_2.1 -setitimer - setitimer 3 __setitimer setitimer@@GLIBC_2.1 -utimes - utimes 2 __utimes utimes@@GLIBC_2.1 -getrusage - getrusage 2 __getrusage getrusage@@GLIBC_2.1 -wait4 - wait4 4 __wait4 wait4@@GLIBC_2.1 +# timeval64 entry points (see osf_*.c for GLIBC_2.0 timeval32 equivalents) +gettimeofday - gettimeofday i:pP __GI___gettimeofday gettimeofday@@GLIBC_2.1 __gettimeofday@@GLIBC_2.1 +settimeofday - settimeofday i:PP __settimeofday settimeofday@@GLIBC_2.1 +getitimer - getitimer i:ip __getitimer getitimer@@GLIBC_2.1 +setitimer - setitimer i:ipP __setitimer setitimer@@GLIBC_2.1 +utimes - utimes i:sp __utimes utimes@@GLIBC_2.1 +getrusage - getrusage i:ip __getrusage getrusage@@GLIBC_2.1 +wait4 - wait4 i:iWiP __wait4 wait4@@GLIBC_2.1 # avoid 64-bit aliases on 32-bit statfs syscalls fstatfs - fstatfs i:ip __fstatfs fstatfs |