Handle AT_EMPTY_PATH for fstatat64 #1812
Open
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 adds correct handling for the
AT_EMPTY_PATH
flag infstatat64
.AT_EMPTY_PATH
allows an empty string to be specified as the path, in which casefstatat
should operate on the file pointed at by the fd itself:This behavior is relied on by newer glibc when loading shared objects. Currently we return
-ENOENT
for empty paths, leading to behavior like:With the fix:
Note that many glibc programs are still broken. I'm playing around with getting a Nix-based environment running in iSH and while I was able to start bash and run some small programs, Nix itself still doesn't run:
getcontext()
andsetcontext()
save and restorefs
(racket needs fs register #370)5 illegal instruction at 0xf749e35f: 66 8c e2 89 50 18 8d 88
(mov dx, fs
)