Re: [PATCH v3 1/1] pidfd: implement PIDFD_THREAD flag for pidfd_open()

From: Oleg Nesterov
Date: Thu Feb 01 2024 - 13:14:28 EST


On 02/01, Christian Brauner wrote:
>
> One more thing that came to my mind. We also support waitid(P_PIDFD,
> pidfd). And I just looked through the code and I think it does the right
> thing when we pass it a PIDFD_THREAD pidfd

Yes, I too looked into kernel_waitid_prepare(P_PIDFD) and didn't notice
anything wrong,

> because wait_consider_task()

Even simpler, I think. waitid(P_PIDFD, pidfd_with_PIDFD_THREAD) doesn't
really differ from waitid(P_PID, pidfd_pid(pidfd_with_PIDFD_THREAD)), so
it should work "as expected".

Oleg.