[LTP] syscalls: Add epoll_ctl07
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed Jul 15 14:59:55 CEST 2026
Hi Cyril,
On Wed, Jul 15, 2026, Cyril Hrubis wrote:
> syscalls: Add epoll_ctl07
--- [PATCH 1/5] ---
> The epoll_ctl05 exercies the loop detector with a longer chain this
> test does the same but only with two epoll fds.
Typo: "exercies" should be "exercises". Also the sentence runs on --
a period or semicolon is needed after "longer chain".
--- [PATCH 2/5] ---
> That checks that subsequent calls to epoll() return all events if there
> were more events than the size of the events array passed to epoll.
The syscall under test is epoll_wait(2), not epoll(). Should read
"subsequent calls to epoll_wait()".
> +static void close_fds(int fds[][2], int n)
> +{
> + int i;
> +
> + for (i = 0; i < n; i++) {
> + if (fds[i][0] > 0) {
The check `> 0` uses 0 as the "not opened" sentinel, but fd 0 is a
valid file descriptor. If SAFE_PIPE() returns fd 0 for fds[i][0]
(which happens when stdin has been closed), both pipe ends would leak.
The convention in this file is already `!= -1` (see epfd). Initialise
the arrays to {-1, -1} and guard with `!= -1`.
--- [PATCH 3/5] ---
> + for (i = 0; i < NREADY; i++) {
> + if (ready_fds[i][0] > 0) {
Same `> 0` sentinel issue as in epoll_wait13. The static array is
zero-initialised, but fd 0 is a valid descriptor. Use {-1, -1}
initialisation and guard with `!= -1`.
--- [PATCH 5/5] ---
> + nwoken = tst_atomic_load(woken);
> + if (nwoken != round+1) {
> + tst_res(TFAIL,
> + "event %d woke %d waiters in total, expected %d",
> + round+1, nwoken, round);
The condition tests `nwoken != round+1`, so the expected count is
`round+1`, but the third format argument is `round`. When round=0 and
nwoken=2 the message reads "expected 0" instead of "expected 1".
The last argument should be `round+1`.
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