[LTP] [PATCH v2 1/2] epoll_pwait: Refactor timeout to struct timespec
Martin Doucha
mdoucha@suse.cz
Wed Jun 4 14:10:22 CEST 2025
Hi!
On 04. 06. 25 8:35, Petr Vorel wrote:
> Hi Martin,
>
>> Support higher precision timeout in do_epoll_pwait() by passing struct
>> timespec instead of int value in milliseconds. Only one test actually
>> uses the parameter.
>
> Ah, you mean epoll_pwait03.c.
Yes.
> Reviewed-by: Petr Vorel <pvorel@suse.cz>
>
> ...
>> +++ b/testcases/kernel/syscalls/epoll_pwait/epoll_pwait_var.h
>> @@ -14,22 +14,22 @@
>> #define NSEC_PER_MSEC (1000000L)
>
>> static int do_epoll_pwait(int epfd, struct epoll_event *events, int
>> - maxevents, int timeout, const sigset_t *sigmask)
>> + maxevents, struct timespec *timeout, const sigset_t *sigmask)
>> {
>> - if (tst_variant == 0)
>> - return epoll_pwait(epfd, events, maxevents, timeout, sigmask);
>> + if (tst_variant == 0) {
>> + int timeout_ms = -1;
>
> very nit: I would reverse the condition to save indent for tst_variant == 0:
Feel free to do it during merge, but it'd be better to check
(tst_variant == 1) instead in case there will be epoll_pwait3() in the
future.
>
> if (tst_variant != 0)
> return epoll_pwait2(epfd, events, maxevents, timeout, sigmask);
> ...
--
Martin Doucha mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic
More information about the ltp
mailing list