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

From: Gleb Popov <arrowd_at_freebsd.org>
Date: Fri, 28 Mar 2025 12:16:52 UTC
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?