about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/tst-timerfd.c
Commit message (Collapse)AuthorAgeFilesLines
* linux: Only use 64-bit syscall if required for timerfd_settimeAdhemerval Zanella2021-06-221-2/+32
| | | | | | | | | | | 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. 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>
* tst: Fix tst-timerfd testLukasz Majewski2021-03-021-11/+4
| | | | | | | | | | | | | | | | | | | There were following problems discovered for tst-timerfd test: 1. Do not set the struct itimerspec's it_interval tv_sec to 2 seconds. After this change the timerfd will trigger only once (the it_value is only set in this case). 2. The 'val1' variable (including the call to timerfd_gettime) is not needed anymore, as it is just enough to read the struct itimerspec after sleep. As a consequence the 'val2' has been renamed to 'val'. 3. After calling timerfd_gettime, the value of struct itimerspec time, when timer is running, is the remaining time. In the case of this test it would be less than 1 second. As a result the TEST_COMPARE macro logic had to be adjusted. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* tst: Provide test for timerfd related functionsLukasz Majewski2021-02-081-0/+65
This change adds new test to assess functionality of timerfd_* functions. It creates new timer (operates on its file descriptor) and checks if time before and after sleep is between expected values.