Re: [PATCH v2] selftests/pidfd: wait for POLLHUP before reading exit info
From: Oleg Nesterov
Date: Sun Oct 18 2026 - 12:25:29 EST
On 10/17, fujo wrote:
>
> @@ -799,7 +799,7 @@ TEST(autokill_pidfd_open_no_effect)
>
> /* Verify child is still alive by polling the clone3 pidfd. */
> pfd.fd = pidfd;
> - pfd.events = POLLIN;
> + pfd.events = POLLHUP;
> ret = poll(&pfd, 1, 0);
> ASSERT_EQ(ret, 0) {
> TH_LOG("Child died after closing pidfd_open fd — should still be alive");
This chunk doesn't look right, POLLIN makes more sense in this case.
Unless I am confused, this poll(timeout = 0) tries to verify that the
child does not exit and report POLLIN, with or without POLLHUP.
Oleg.