glibc/include
Lukasz Majewski 6f5eb5b2e5 y2038: linux: Provide __mq_timedsend_time64 implementation
This patch provides new __mq_timedsend_time64 explicit 64 bit function for
sending messages with absolute timeout.
Moreover, a 32 bit version - __mq_timedsend has been refactored to internally
use __mq_timedsend_time64.

The __mq_timedsend is now supposed to be used on systems still supporting 32
bit time (__TIMESIZE != 64) - hence the necessary conversion to 64 bit struct
__timespec64 from struct timespec.

The new __mq_timedsend_time64 syscall available from Linux 5.1+ has been used,
when applicable.

As this wrapper function is also used internally in the glibc, to e.g. provide
mq_send implementation, an explicit check for abs_timeout being NULL has been
added due to conversions between struct timespec and struct __timespec64.
Before this change the Linux kernel handled this NULL pointer.

Build tests:
- ./src/scripts/build-many-glibcs.py glibcs

Run-time tests:
- Run specific tests on ARM/x86 32bit systems (qemu):
  https://github.com/lmajewski/meta-y2038 and run tests:
  https://github.com/lmajewski/y2038-tests/commits/master

Linux kernel, headers and minimal kernel version for glibc build test matrix:
- Linux v5.1 (with mq_timedsend_time64) and glibc built with v5.1 as a
  minimal kernel version (--enable-kernel="5.1.0")
  The __ASSUME_TIME64_SYSCALLS flag defined.

- Linux v5.1 and default minimal kernel version
  The __ASSUME_TIME64_SYSCALLS not defined, but kernel supports
  mq_timedsend_time64 syscall.

- Linux v4.19 (no mq_timedsend_time64 support) with default minimal kernel
  version for contemporary glibc (3.2.0)
  This kernel doesn't support mq_timedsend_time64 syscall, so the fallback to
  mq_timedsend is tested.

Above tests were performed with Y2038 redirection applied as well as without
(so the __TIMESIZE != 64 execution path is checked as well).

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2020-04-06 23:05:11 +02:00
..
arpa
bits Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
gnu Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
net
netinet
programs Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
protocols
rpc
rpcsvc
sys linux: Use long time_t for wait4/getrusage 2020-04-02 09:21:06 -07:00
aio.h
aliases.h
alloc_buffer.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
alloca.h
allocate_once.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
ar.h
argp-fmtstream.h
argp.h
argz.h
array_length.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
assert.h
atomic.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
byteswap.h
complex.h
cpio.h
crypt.h
ctype.h
des.h
dirent.h
dlfcn.h dlfcn: Remove remnants of caller sensitivity from dlinfo 2019-10-16 18:21:30 +02:00
dso_handle.h
elf.h
endian.h
envz.h
err.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
errno.h
error.h
execinfo.h
fcntl.h
features.h Update version numbers for 2.31 release 2020-02-01 17:16:54 +05:30
fenv.h
file_change_detection.h Move implementation of <file_change_detection.h> into a C file 2020-02-18 13:44:48 +01:00
float.h
fmtmsg.h
fnmatch.h
fpu_control.h
fstab.h
fts.h
ftw.h
gconv.h
getopt_int.h
getopt.h
glob.h
gmp.h
gnu-versions.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
grp-merge.h
grp.h
gshadow.h
iconv.h
ifaddrs.h
ifreq.h
ifunc-impl-list.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
inline-hashtab.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
intprops.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
inttypes.h
langinfo.h
lastlog.h
libc-diag.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-internal.h csu: Use ELF constructor instead of _init in libc.so 2020-02-25 14:58:52 +01:00
libc-pointer-arith.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
libc-symbols.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
libgen.h
libintl.h
limits.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
link.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
list_t.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
list.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
locale.h
loop_unroll.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
malloc.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
math-narrow-eval.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
math.h ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions 2020-02-28 08:20:02 -06:00
mcheck.h
memory.h
mntent.h
monetary.h ldbl-128ibm-compat: Add strfmon_l with IEEE long double format 2019-12-03 13:30:37 -03:00
mqueue.h y2038: linux: Provide __mq_timedsend_time64 implementation 2020-04-06 23:05:11 +02:00
netdb.h nss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS 2020-02-25 16:15:09 +01:00
netgroup.h
nl_types.h
nss.h
nsswitch.h
obstack.h
plural-exp.h
poll.h
printf.h
pthread.h
pty.h
pwd.h
random-bits.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
re_comp.h
regex.h
regexp.h
resolv.h
rounding-mode.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
rtld-malloc.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
sched.h Add hidden prototypes for __sched_getparam, __sched_getscheduler 2020-02-20 08:57:01 +01:00
scratch_buffer.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
search.h
set-hooks.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
setjmp.h
sgtty.h
shadow.h
shlib-compat.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
signal.h
spawn.h
stab.h
stackinfo.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stap-probe.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stdc-predef.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stdint.h
stdio_ext.h
stdio.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
stdlib.h ld.so: Do not export free/calloc/malloc/realloc functions [BZ #25486] 2020-02-15 11:01:23 +01:00
string.h
strings.h
struct___timespec64.h y2038: include: Move struct __timespec64 definition to a separate file 2020-04-06 23:05:11 +02:00
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h
tgmath.h
time.h y2038: include: Move struct __timespec64 definition to a separate file 2020-04-06 23:05:11 +02:00
ttyent.h
uchar.h
ucontext.h
ulimit.h
unistd.h hurd: Fix ld.so __access override from libc 2019-12-01 21:05:56 +00:00
utime.h
utmp.h
values.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
verify.h posix: Sync regex with gnulib 2019-11-06 09:20:52 -03:00
wait.h
wchar.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
wctype.h
wordexp.h