[LTP] syscalls: Add epoll_create03
Cyril Hrubis
chrubis@suse.cz
Thu Jul 9 16:03:53 CEST 2026
Hi!
> --- [PATCH 7/9] ---
>
> > rval = poll(fds, nfds, timeout);
> > if (rval == -1) {
> > tst_brk_(file, lineno, TBROK | TERRNO,
> > "poll(%p, %li, %i) failed", fds, (long)nfds, timeout);
> > } else if (rval < -1) {
> > tst_brk_(file, lineno, TBROK | TERRNO,
> > "Invalid poll(%p, %li, %i) return value %i",
> > fds, (long)nfds, timeout, rval);
> > }
>
> poll() returns -1 on error or >= 0 on success; it cannot return a
> value less than -1. The else-if branch is dead code.
>
> The nearby safe_statvfs() uses "else if (rval)" to catch unexpected
> non-zero returns for a function that is 0 on success. poll() returns
> 0 (timeout) and positive values (events ready) as normal outcomes, so
> no such secondary check applies here. The body should just have the
> rval == -1 guard and return rval.
I will ignore this one since we are guarding againts kernel bugs with
this code. I.e. if kernel returns impossible value we want the test to
report it.
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list