Re: [PATCH v2] selftests/pidfd: wait for POLLHUP before reading exit info

From: fujo

Date: Sun Oct 18 2026 - 12:52:11 EST


Hi Oleg,

> 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.

You are right, thanks. That poll() is a liveness check, not an
exit-info wait, so v3 keeps POLLIN there and only switches the polls
that are followed by PIDFD_GET_INFO.

About the documentation: there is no in-tree KAPI file for this; the
wording I referred to is the CLONE_AUTOREAP series description ("poll
the child's exit via poll() and retrieve exit status via
PIDFD_GET_INFO"). If you or Christian think a clarifying sentence
belongs somewhere in the tree, I'm happy to send it, but I didn't want
to guess where.

Thanks,
fujo