Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add wasip2 implementations of more socket APIs #482

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

dicej
Copy link
Contributor

@dicej dicej commented Mar 13, 2024

This adds wasm32-wasip2 implementations of shutdown, getsockopt, and setsockopt. It also extends the existing ioctl implementation to handle both p1 and p2 file descriptors since we can't know until runtime which kind we have. Once we've moved wasm32-wasip2 fully to WASI 0.2 and remove the need for the p1 adapter, we'll be able to switch to separate p1 and p2 ioctl implementations.

This adds `wasm32-wasip2` implementations of `shutdown`, `getsockopt`, and
`setsockopt`.  It also extends the existing `ioctl` implementation to handle
both p1 and p2 file descriptors since we can't know until runtime which kind we
have. Once we've moved `wasm32-wasip2` fully to WASI 0.2 and remove the need for
the p1 adapter, we'll be able to switch to separate p1 and p2 `ioctl`
implementations.

Co-authored-by: Dave Bakker <github@davebakker.io>
Signed-off-by: Joel Dice <joel.dice@fermyon.com>
Copy link
Member

@sunfishcode sunfishcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! It's a little unfortunate to add new code to the cloudlibc directory, but I know why it's there, and we can factor that out later.

@sunfishcode sunfishcode merged commit 6593687 into WebAssembly:main Mar 19, 2024
8 checks passed
@dicej dicej deleted the wasi-sockets-more-stuff branch March 19, 2024 18:17
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.

2 participants