glibc/include
Lukasz Majewski 258c242128 y2038: linux: Provide __ppoll64 implementation
This patch provides new __ppoll64 explicit 64 bit function for handling polling
events (with struct timespec specified timeout) for a set of file descriptors.
Moreover, a 32 bit version - __ppoll has been refactored to internally use
__ppoll64.

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

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

The Linux kernel checks if passed tv_nsec value overflows, so there is no need
to repeat it in the glibc.

When ppoll syscall on systems supporting 32 bit time ABI is used, the check is
performed if passed data (which may have 64 bit tv_sec) fits into 32 bit range.

Build tests:
- The code has been tested on x86_64/x86 (native compilation):
make PARALLELMFLAGS="-j8" && make check PARALLELMFLAGS="-j8" && \\
make xcheck PARALLELMFLAGS="-j8"

- The glibc has been build tested (make PARALLELMFLAGS="-j8") for
x86 (i386), x86_64-x32, and armv7

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

- Use of cross-test-ssh.sh for ARM (armv7):
  make PARALLELMFLAGS="-j8" test-wrapper='./cross-test-ssh.sh root@192.168.7.2' xcheck

Linux kernel, headers and minimal kernel version for glibc build test
matrix:
- Linux v5.1 (with ppoll_time64) and glibc build 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 ppoll_time64
  syscall.

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

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

No regressions were observed.
2019-11-11 14:41:43 +01:00
..
arpa CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings [BZ #20018] 2019-01-21 21:26:03 +01:00
bits Split up endian.h to minimize exposure of BYTE_ORDER. 2019-10-01 14:54:46 -07:00
gnu Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
net
netinet Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
programs Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
protocols
rpc Run thread shutdown functions in an explicit order 2018-06-26 15:27:12 +02:00
rpcsvc Add missing header wrappers under include/ 2019-02-16 08:25:16 +01:00
sys y2038: linux: Provide __ppoll64 implementation 2019-11-11 14:41:43 +01:00
aio.h
aliases.h
alloc_buffer.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
alloca.h Remove macros extend_alloca, extend_alloca_account [BZ #18023] 2018-06-27 19:20:37 +02:00
allocate_once.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07: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 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
assert.h
atomic.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07: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-opt: Add err, errx, verr, verrx, warn, warnx, vwarn, and vwarnx (bug 23984) 2019-03-01 15:24:51 -03:00
errno.h hurd: Fix accessing errno from rtld 2018-03-25 00:48:01 +01:00
error.h ldbl-opt: Add error and error_at_line (bug 23984) 2019-03-01 15:26:36 -03:00
execinfo.h
fcntl.h Fix Linux fcntl OFD locks for non-LFS architectures (BZ#20251) 2018-06-26 13:22:53 -03:00
features.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
fenv.h Move fenv.h soft-float inlines from fenv_private.h to include/fenv.h. 2018-09-04 19:52:06 +00: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.h
getopt_int.h
glob.h
gmp.h
gnu-versions.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
grp-merge.h
grp.h
gshadow.h
iconv.h
ifaddrs.h
ifreq.h
ifunc-impl-list.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
inline-hashtab.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
intprops.h Sync intprops.h with gnulib 2019-10-31 17:02:49 -03: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 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-internal.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-pointer-arith.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libc-symbols.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
libgen.h
libintl.h
limits.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
link.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
list.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
list_t.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
locale.h
loop_unroll.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
malloc.h Don't declare __malloc_check_init in <malloc.h> (bug 23352) 2019-07-10 15:04:05 +02:00
math-narrow-eval.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
math.h Use copysign functions not __copysign functions in glibc libm. 2018-09-27 20:04:48 +00:00
mcheck.h
memory.h
mntent.h
monetary.h Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl. 2018-11-16 09:21:14 -02:00
mqueue.h
netdb.h
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 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07: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 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
sched.h Don't use __typeof__ (getcpu) 2018-12-07 12:47:41 -08:00
scratch_buffer.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
search.h misc: Add twalk_r function 2019-05-02 11:42:51 +02:00
set-hooks.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07: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 Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
signal.h
spawn.h posix: Use posix_spawn for wordexp 2019-10-09 17:48:41 -03:00
stab.h
stackinfo.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stap-probe.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stdc-predef.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07:00
stdint.h Move inttypes.h and stdint.h to stdlib. 2019-03-13 09:42:09 -04:00
stdio.h Do not print backtraces on fatal glibc errors 2019-08-19 15:41:29 +02:00
stdio_ext.h
stdlib.h
string.h Run thread shutdown functions in an explicit order 2018-06-26 15:27:12 +02:00
strings.h
stubs-prologue.h
syscall.h
sysexits.h
syslog.h
tar.h
termios.h
tgmath.h
time.h sysdeps/clock_nanosleep: Use clock_nanosleep_time64 if avaliable 2019-11-08 12:06:17 -08:00
ttyent.h
uchar.h
ucontext.h
ulimit.h
unistd.h hurd: Fix linknamespace of spawni 2018-12-07 20:21:45 +01:00
utime.h
utmp.h
values.h Prefer https to http for gnu.org and fsf.org URLs 2019-09-07 02:43:31 -07: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 wcsmbs: optimize wcscat 2019-02-27 10:00:37 -03:00
wctype.h
wordexp.h