Re: [PATCH v3 8/9] syscalls: Add epoll_wait12

Petr Vorel <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <20260710072744.GC1157094@pevik>
Hi Cyril,

LGTM.
Reviewed-by: Petr Vorel <[email protected]>

...
> +static void run(void)
> +{
> +	pid_t pid;
> +
> +	SAFE_PIPE(fds);
> +	fill_pipe(fds[1]);
> +
> +	efd = SAFE_EPOLL_CREATE1(0);
> +
> +	struct epoll_event ev = {
> +		.events = EPOLLOUT,
> +		.data.fd = fds[1],
> +	};
> +
> +	SAFE_EPOLL_CTL(efd, EPOLL_CTL_ADD, fds[1], &ev);
> +
> +	pid = SAFE_FORK();
> +	if (!pid) {
> +		SAFE_CLOSE(fds[0]);
> +
> +		TEST(epoll_wait(efd, &ev, 1, 5000));
> +		if (TST_RET != 1) {
> +			tst_res(TFAIL | TTERRNO,
> +				"epoll_wait() returned %li, expected 1",
> +				TST_RET);
> +			exit(0);
> +		}

nit: Using TST_EXP_VAL_SILENT(..., 1) would be shorter:
		TST_EXP_VAL_SILENT(epoll_wait(efd, &ev, 1, 5000), 1);
		if (!TST_PASS)
			exit(0);

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.