musl/arch/x32
Rich Felker 40aa18d55a internally, define time64 syscalls on x32 as the existing syscalls
x32 is odd in that it's the only ILP32 arch/ABI we have where time_t
is 64-bit rather than (32-bit) long, and this has always been
problematic in that it results in struct timespec having unused
padding space, since tv_nsec has type long, which the kernel insists
be zero- or sign-extended (due to negative tv_nsec being invalid, it
doesn't matter which) to match the x86_64 type.

up til now, we've had really ugly hacks in x32/syscall_arch.h to patch
up the timespecs passed to the kernel. but the same requirement to
zero- or sign-extend tv_nsec also applies to all the new time64
syscalls on true 32-bit archs. so let's take advantage of this to
clean things up.

this patch defines all of the time64 syscalls for x32 as aliases for
the existing syscalls by the same name. this establishes the following
invariants:

- if the time64 form is defined, it takes time arguments as 64-bit
  objects, and tv_nsec inputs must be zero-/sign-extended to 64-bit.

- if the time64 form is not defined, or if the time64 form is defined
  and is not equal to the "plain" form, the plain form takes time
  arguments as longs.

this will avoid the need for protocols for archs to define appropriate
types for each family of syscalls, and for the reader of the code to
have to be aware of such type definitions.

in some sense it might be simpler if the plain syscall form were
undefined for x32, so that it would always take longs if defined.
however, a number of these syscalls are used in contexts with a null
time argument, or (e.g. futex) for commands that don't involve time at
all, and having to introduce time64-specific logic to all those call
points does not make sense. thus, while the "plain" forms are kept now
just because they're needed until the affected code is converted over,
they'll also almost surely be kept in the future as well.
2019-07-27 13:43:13 -04:00
..
bits add new syscall numbers from linux v5.1 2019-07-01 14:20:58 -04:00
atomic_arch.h remove a_ctz_l from arch specific atomic_arch.h 2018-04-19 12:23:17 -04:00
crt_arch.h dynamic linker bootstrap overhaul 2015-04-13 03:04:42 -04:00
ksigaction.h apply hidden visibility to sigreturn code fragments 2018-09-12 14:34:34 -04:00
kstat.h decouple struct stat from kernel type 2019-07-18 19:38:12 -04:00
pthread_arch.h make thread-pointer-loading asm non-volatile 2018-10-16 14:11:46 -04:00
reloc.h new dlstart stage-2 chaining for x86_64 and x32 2015-09-17 07:28:44 +00:00
syscall_arch.h internally, define time64 syscalls on x32 as the existing syscalls 2019-07-27 13:43:13 -04:00