[pseudo] [PATCH v3 0/2] close_range: implement it rather than return ENOSYS
Babanpreet Singh <[email protected]> Wed, 5 Aug 2026 06:22:56 +0000
| Newsgroups | org.yoctoproject.lists.yocto-patches |
|---|---|
| Message-ID | <[email protected]> |
Richard, I took the writing rather than leave it to you. This is the one
op version.
close_range() and closefrom() both go through OP_CLOSE_RANGE now. Based on
the two commits you have on master-next (5ce47e3 + 2d235dd), and the only
changes from those are:
- OP_CLOSEFROM dropped from enums/op.in.
- Its case in pseudo_client_op() went with it. OP_CLOSE_RANGE already
does the same walk over pseudo's own descriptors, and the ignore-path
exemption now names one op instead of two.
- closefrom() calls the op with INT_MAX for the maximum.
- pseudo_client_closefrom() folded into pseudo_client_close_range(),
which clamps to nfds anyway, so INT_MAX means what closefrom() wants.
The rest is your version, tweaks and all. pseudo_client.c comes out at
+28/-10 against master rather than +67/-1.
2/2 is your test commit with nothing touched in it. I dropped your
Signed-off-by from both, since 1/2 is no longer the code you signed off on
and carrying it on 2/2 alone looked worse than dropping both.
Tested on x86_64, glibc 2.39, kernel 6.17.0-22:
- ./run_tests.sh: 45 tests, 5 skipped for missing xattr and acl support
in this container, everything else passing except test-parallel-rename
and test-parallel-symlinks. Those two are flaky here rather than
broken by this: they fail on pristine 2a5521e as well, and across
three runs of this branch one of them passed once.
- The probe matrix from July, run against this branch and against a build
of your master-next version: byte identical output. It covers
close_range(fd, ~0U, 0) with no path lists, under PSEUDO_IGNORE_PATHS,
and under an OE-style PSEUDO_INCLUDE_PATHS, the maxfd variants
(~0U, UINT_MAX-1, INT_MAX, 4096, fd), closefrom() under that same
include list, and pseudo still faking ownership after both calls.
- linux-libc-headers do_install, with pseudo-native built from this
branch: succeeds. That is the task that died on valkyrie in July.
One gap I should name: the suite has no closefrom() test, so what the
rewiring did to closefrom is covered by that probe and not by anything in
the tree. I left it out because closefrom() is not declared before glibc
2.34 and I did not want to guess at what that does to the test build on
older hosts. Happy to add a case to 2/2 if you would rather have it.
Babanpreet Singh (2):
ports/linux/guts: Implement close_range() instead of returning ENOSYS
tests: Add close_range() test
enums/op.in | 2 +-
ports/linux/guts/close_range.c | 59 ++++++-
ports/linux/guts/closefrom.c | 3 +-
ports/linux/portdefs.h | 16 ++
pseudo_client.c | 38 +++--
test/test-close-range.c | 283 +++++++++++++++++++++++++++++++++
test/test-close-range.sh | 24 +++
7 files changed, 406 insertions(+), 19 deletions(-)
create mode 100644 test/test-close-range.c
create mode 100755 test/test-close-range.sh
--
2.43.0