Re: [PATCH] pidfd: add ioctl to retrieve pid info

From: Josh Triplett
Date: Mon Oct 07 2024 - 10:56:14 EST


Christian Brauner wrote:
> struct pidfd_info {
> /* Let userspace request expensive stuff explictly. */
> __u64 request_mask;
> /* And let the kernel indicate whether it knows about it. */
> __u64 result_mask;

I don't think it's necessary to have these two fields separate. The kernel should write to the same mask field userspace used.

In theory there could be an operation to probe for *everything* the kernel understands, but in practice with a binary structure there's little point finding out about flags you don't know the corresponding structure bits for.