Skip to content

Conversation

@alexcrichton
Copy link
Collaborator

The main goal of this commit is to simplify what's located in the descriptor table of libc. Primarily directory streams are no longer located in the table and are instead stored directly in the DIR* structure. Additionally the wasip1-style cookie is removed in favor of a wasip2-specific offset counter. Along the way
__wasilibc_nocwd_scandirat was rewritten for both wasip1 and wasip2 to be built on openat + fdopendir. This removes WASI-version-specific code and makes this look more similar to scandir elsewhere in libc.

The main goal of this commit is to simplify what's located in the
descriptor table of libc. Primarily directory streams are no longer
located in the table and are instead stored directly in the `DIR*`
structure. Additionally the wasip1-style `cookie` is removed in favor of
a wasip2-specific offset counter. Along the way
`__wasilibc_nocwd_scandirat` was rewritten for both wasip1 and wasip2 to
be built on `openat` + `fdopendir`. This removes WASI-version-specific
code and makes this look more similar to `scandir` elsewhere in libc.
@alexcrichton alexcrichton changed the title Reimplement directory streams wasip2: Reimplement directory streams Nov 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant