Re: Would we want pidfd_open(2) & SO_PEERPIDFD?

From: Vadim Goncharov <vadimnuclight_at_gmail.com>
Date: Fri, 28 Mar 2025 13:28:04 UTC
On Fri, 28 Mar 2025 15:16:52 +0300
Gleb Popov <arrowd@freebsd.org> wrote:

> On Tue, Mar 25, 2025 at 8:27 AM Gleb Popov <arrowd@freebsd.org> wrote:
> >
> > The high level code expects a descriptor with some properties, so we
> > either provide it or have to patch large parts of the code using it.
> > Emulating pidfd somehow is also fine to me, but I have no idea how to
> > do that. libinotify-kqueue example shows that emulating a descriptor
> > with certain properties is quite a non-trivial task.  
> 
> A bit orthogonal to the Capsicum discussion, I wonder if the following
> idea makes sense:
> 
> We do have FUSE as a framework to implement filesystems from the
> userspace, same goes for CUSE that allows for programming character
> devices. Maybe having some sort of FDUSE providing a way to create
> "custom" descriptors and define their behaviour from userspace would
> be useful?

And how do you imagine such an API ?


-- 
WBR, @nuclight