Repository navigation
Support readlink of /proc/self/fd entries - #1700
Merged
Merged
Conversation
Weidong Cui (wdcui)
force-pushed
the
wdcui/ulitebox/proc-fd-links
branch
2 times, most recently
from
October 22, 2026 12:09
9959318 to
bd2297b
Compare
Record each broker-opened file's absolute path, with symbolic links resolved, on its File and expose it through a new handle-based HandlePath file request. The Linux shim uses it to answer readlink of /proc/self/fd/N for files and names non-file descriptors by kind, so ttyname() on /dev/tty no longer hits unimplemented!(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Record the resolved absolute path on the resolver entry created by open and read it through a Service::handle_path method, like handle_status, instead of keeping a copy on File. This keeps Resolver::open's signature and drops open_with_path_returned. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1172b488-1351-40c1-a6d0-32f5277af568
Weidong Cui (wdcui)
force-pushed
the
wdcui/ulitebox/proc-fd-links
branch
from
October 25, 2026 21:29
06f97ea to
dc7cd90
Compare
|
🤖 SemverChecks 🤖 Click for details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes readlink of /proc/self/fd/N, which hit unimplemented!() for N ≥ 3 and crashed ttyname() on a /dev/tty descriptor. The broker now records each opened file's absolute path, with symbolic links resolved, and returns it through a new handle-based HandlePath request. The Linux shim reports that path for descriptors of broker-opened files, names other descriptors by kind as Linux does (e.g. pipe:[0]), stats these links through the descriptor itself, and returns ENOENT for descriptors that aren't open.