glibc/include
Lukasz Majewski 0b65a8fbaf y2038: linux: Provide __mq_timedreceive_time64 implementation
This patch provides new __mq_timedreceive_time64 explicit 64 bit function for
receiving messages with absolute timeout.
Moreover, a 32 bit version - __mq_timedreceive has been refactored to
internally use __mq_timedreceive_time64.

The __mq_timedreceive 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_receive 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_timedreceive_time64) and glibc built with v5.1 as
  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_timedreceive_time64 syscall.

- Linux v4.19 (no mq_timedreceive_time64 support) with default minimal kernel
  version for contemporary glibc (3.2.0)
  This kernel doesn't support mq_timedreceive_time64 syscall, so the fallback to
  mq_timedreceive 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 CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-01-21 21:26:03 +01:00
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 Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
programs Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
protocols
rpc
rpcsvc Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
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 Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
argp-fmtstream.h
argp.h ldbl-opt: Add argp_error and argp_failure (bug 23983) 2019-03-01 15:21:32 -03:00
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 <dirent.h>: Remove wrong comment about getdents64 declaration 2019-10-09 11:31:03 +02:00
dlfcn.h dlfcn: Remove remnants of caller sensitivity from dlinfo 2019-10-16 18:21:30 +02:00
dso_handle.h
elf.h elf: Refuse to dlopen PIE objects [BZ #24323] 2019-06-18 16:42:10 +02:00
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 ldbl-opt: Add error and error_at_line (bug 23984) 2019-03-01 15:26:36 -03:00
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 Make totalorder and totalordermag functions take pointer arguments. 2019-08-15 15:18:34 +00:00
fmtmsg.h
fnmatch.h
fpu_control.h
fstab.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
fts.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
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 Move inttypes.h and stdint.h to stdlib. 2019-03-13 09:42:09 -04:00
langinfo.h
lastlog.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
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_timedreceive_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 Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
regex.h
regexp.h Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
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 misc: Add twalk_r function 2019-05-02 11:42:51 +02:00
set-hooks.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
setjmp.h Make totalorder and totalordermag functions take pointer arguments. 2019-08-15 15:18:34 +00:00
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 posix: Use posix_spawn for wordexp 2019-10-09 17:48:41 -03:00
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 Move inttypes.h and stdint.h to stdlib. 2019-03-13 09:42:09 -04:00
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 Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
wchar.h ldbl-128ibm-compat: PLT redirects for using ldbl redirects internally 2020-03-25 14:34:23 -05:00
wctype.h
wordexp.h