Repository navigation
fix: handle AT_FDCWD with AT_EMPTY_PATH in fstatat - #927
Merged
alexcrichton merged 1 commit intoNov 30, 2026
Merged
Conversation
eduardomourar
force-pushed
the
fix/fstatat-at-fdcwd-empty-path
branch
from
November 29, 2026 13:41
dc66e05 to
b81be4b
Compare
alexcrichton
approved these changes
Nov 30, 2026
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.
Summary
__wasilibc_statreturnENOENTfor an empty path, and gave__wasilibc_nocwd_fstatatits ownAT_EMPTY_PATHhandling for a realdirfd.fstatat'sAT_FDCWDdispatch inat_fdcwd.croutes straight into__wasilibc_stat(pathname, ...)without checkingAT_EMPTY_PATHfirst, sofstatat(AT_FDCWD, "", buf, AT_EMPTY_PATH)incorrectly returnedENOENTinstead of statting the current working directory.AT_EMPTY_PATHcheck to theAT_FDCWDdispatch, resolving an empty path withAT_EMPTY_PATHto".".Test plan
fstatat(AT_FDCWD, "", ...)cases totest/src/stat.c, mirroring the existingdirfdcases added in fix: empty stat-family paths #882.