[LTP] [PATCH v3 3/9] syscalls: Add epoll_wait09

Petr Vorel pvorel@suse.cz
Fri Jul 10 08:41:49 CEST 2026


Hi Cyril,

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Test checks that events from recursive epoll are propagated correctly.
+1

> +/*\
> + * Verify that :manpage:epoll_wait() works with nested epoll instances up to
> + * the maximum nesting depth of 5 allowed by the kernel (EP_MAX_NESTS).
> + *
> + * [Algorithm]
> + *
> + * - Create a pipe.
> + * - Build a chain of epoll instances of the given depth where the innermost
> + *   monitors the pipe read end and each subsequent one monitors the previous.
> + * - Write data to the pipe.
> + * - Call :manpage:epoll_wait() on the outermost epoll instance and verify it
> + *   reports EPOLLIN.
> + * - Walk the chain inward calling epoll_wait on each level and verify that
> + *   every level reports EPOLLIN on the expected fd.
> + * - Read the data from the pipe to drain it.
> + */

Thanks for the description.
> +
> +#include <sys/epoll.h>
> +
> +#include "tst_epoll.h"
> +#include "tst_test.h"
> +
> +#define MAX_DEPTH 5
> +
> +static int epfds[MAX_DEPTH];
> +static int fds[2] = {-1, -1};
> +
> +static struct tcase {
> +	int depth;
> +} tcases[] = {
> +	{2},
> +	{3},
> +	{4},
> +	{5},

nit: why not just define depth in the test?
int depth = n + 2;

And
-	.tcnt = ARRAY_SIZE(tcases),
+	.tcnt = MAX_DEPTH,

That would help having to sync these 3 (tcases[], MAX_DEPTH and .tcnt).

Also, could you run make check to fix formatting complains?

Kind regards,
Petr


More information about the ltp mailing list