[LTP] [PATCH v2 5/8] syscalls: Add epoll_wait10

Cyril Hrubis chrubis@suse.cz
Wed Jul 8 20:51:18 CEST 2026


Hi!
> > +static void check_epoll_event(const char *desc)
> > +{
> > +	struct epoll_event ret_ev;
> > +	char buf[1024];
> > +
> > +	TEST(epoll_wait(efd, &ret_ev, 1, 1000));
> > +	if (TST_RET < 1) {
> > +		tst_res(TFAIL | TTERRNO,
> > +			"epoll_wait() after %s returned %li", desc, TST_RET);
> 
> return; here.

Notice that we need to drain the notification a the bottom, so the best
we can do is goto drain;

> > +	} else if (!(ret_ev.events & (EPOLLPRI | EPOLLERR))) {
> > +		tst_res(TFAIL,
> > +			"after %s: events %x, expected EPOLLPRI or EPOLLERR",
> > +			desc, ret_ev.events);
> > +	} else {
> > +		tst_res(TPASS,
> > +			"epoll_wait() reported event after %s", desc);
> > +	}
> 
> And here I would use TST_EXP_* instead. But feel free to ignore.

However I will shorten this part to TST_EXP_EXPR() so that we have only
one else branch.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list