From 7047250b2ebd96cc9a550009a42e030cc7df624c Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 25 Nov 2025 15:41:32 +0100 Subject: [PATCH] Add request for fd iteration without /proc --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 99a82f8..9cb320f 100644 --- a/README.md +++ b/README.md @@ -1018,3 +1018,17 @@ specific implementations. It would be much nicer and universally applicable if such a check could be done generically. It would probably suffice to provide an `ioctl()` call on the `pidns` file descriptor that reveals this kind of information in some form. + +### A way to iterate process file descriptors without /proc + +[x] A way to iterate process file descriptors without needing +`/proc` mounted. Could be an `ioctl()` which takes a buffer, +size and a `last_fd` argument and fills the buffer with fd +numbers after the provided `last_fd`. + +**Use-Case**: In `mkosi-sandbox` and other sandboxing tools +that let you set up an arbitrary sandbox, we can't rely on the +sandbox having `/proc` mounted, yet we still need to be able to +do systemd's fd packing algorithm. This requires being able to +iterate over all inherited fds in a somewhat efficient manner +without having `/proc` mounted.