[LTP] syscalls: Add epoll_ctl07

linuxtestproject.agent@gmail.com linuxtestproject.agent@gmail.com
Wed Jul 15 13:02:23 CEST 2026


Hi Cyril,

On Wed, 15 Jul 2026 11:41:34 +0200, Cyril Hrubis wrote:
> syscalls: Add epoll_ctl07

--- [PATCH 1/5] ---

> The epoll_ctl05 excercies the loop detector with a longer chain this
> tests does the same but only with two epoll fds.

Two typos: "excercies" -> "exercises", "this tests" -> "this test".

--- [PATCH 2/5] ---

> That checks that subsequent calls to epoll() return all events if there
> were more events than than the size of the events array passed to epoll.

Duplicate word: "than than" -> "than".

--- [PATCH 3/5] ---

> This is another test for maxevents cap, but in this case we do not drain
> the fds so they are newer removed from the ready set.

Typo: "newer" -> "never".

--- [PATCH 4/5] ---

> + * This is the default (non-EPOLLEXCLUSIVE) behavior and serves as the
> + * contrast to the thundering-herd avoidance tested in epoll_wait16.

At the point this patch is applied, epoll_wait16 does not exist yet
(it is added in the next patch). The intermediate tree has a dangling
cross-reference. Consider adding this sentence with patch 5/5, or
rewording to not name the follow-up test explicitly.

--- [PATCH 5/5] ---

The commit subject says "syscalls/epoll_wait15: Add EPOLLEXCLUSIVE
test" but the diff adds epoll_wait16.c, registers epoll_wait16 in
runtest/syscalls, and adds epoll_wait16 to .gitignore. Should the
subject name epoll_wait16?

> +	if (nwoken != round+1) {
> +		tst_res(TFAIL,
> +			"event %d woke %d waiters in total, expected %d",
> +			round, nwoken, round);

The last argument is `round`, but the predicate checks `nwoken !=
round+1`, so the expected value is `round+1`. At round=0 the message
would print "expected 0" when the expected count is 1. Should the last
argument be `round+1`?

> +#include "lapi/epoll.h"

EPOLLEXCLUSIVE is used in this test but is not defined anywhere in
lapi/epoll.h (confirmed: the file defines EPOLL_CLOEXEC and epoll_pwait
fallbacks, but nothing for EPOLLEXCLUSIVE). EPOLLEXCLUSIVE was added to
glibc in 2.24; on older build environments the test will fail to
compile.

A fallback definition belongs in lapi/epoll.h:

  #ifndef EPOLLEXCLUSIVE
  #define EPOLLEXCLUSIVE (1u << 28)
  #endif

> +	if (round == NWAITERS)
> +		tst_res(TPASS, "each event woke exactly one waiter");
> +
> +	SAFE_CLOSE(fds[0]);
> +	SAFE_CLOSE(fds[1]);
> +}

run() forks NWAITERS children but never calls tst_reap_children().
Each child calls exit(0) after the checkpoint wake, so they are all
finished by the time the loop exits, but the parent leaves them as
zombies. The structurally identical epoll_wait15.c calls
tst_reap_children() after its equivalent loop. Should tst_reap_children()
be called here before or after the result is reported?

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer


More information about the ltp mailing list