linux: Only use 64-bit syscall if required for ppoll
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 15 Jun 2021 18:41:00 +0000 (15:41 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 22 Jun 2021 15:09:52 +0000 (12:09 -0300)
commitecf2661281c71a9752c7238ab93bc12b16cfff23
tree4adb5c607a25b04e7e3aff43e1eba5f26823140f
parent92f7b465101c23e45f66c6ad25ba243df49556a0
linux: Only use 64-bit syscall if required for ppoll

For !__ASSUME_TIME64_SYSCALLS there is no need to issue a 64-bit syscall
if the provided timeout fits in a 32-bit one.  The 64-bit usage should
be rare since the timeout is a relative one.  This also avoids the need
to use supports_time64() (which breaks the usage case of live migration
like CRIU or similar).

Checked on i686-linux-gnu on a 4.15 kernel and on a 5.11 kernel
(with and without --enable-kernel=5.1) and on x86_64-linux-gnu.

Reviewed-by: Lukasz Majewski <lukma@denx.de>
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/ppoll.c
sysdeps/unix/sysv/linux/tst-ppoll.c