wasi: Move version-independent socket constants to the shared module, and add SOCK_CLOEXEC - #5336
Merged
Merged
Conversation
… add SOCK_CLOEXEC https://github.com/WebAssembly/wasi-libc/blob/0d5332aceea8e72698b6abc270550e666ba97aea/libc-bottom-half/headers/public/__header_sys_socket.h Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me>
ChihweiLHBird
force-pushed
the
wasi-libc-const-update
branch
from
July 28, 2026 04:06
16e2741 to
9b3a8b7
Compare
ChihweiLHBird
marked this pull request as ready for review
July 28, 2026 04:09
Contributor
Author
|
Not sure why the CI failed. Seems to be unrelated to me |
Member
|
@alexcrichton could you take a look? |
tgross35
approved these changes
Aug 3, 2026
Merged
tgross35
pushed a commit
to dybucc/libc
that referenced
this pull request
Aug 31, 2026
… add SOCK_CLOEXEC https://github.com/WebAssembly/wasi-libc/blob/0d5332aceea8e72698b6abc270550e666ba97aea/libc-bottom-half/headers/public/__header_sys_socket.h Signed-off-by: Zhiwei Liang <zhiwei.liang@zliang.me> (backport <rust-lang#5336>) (cherry picked from commit 7518e54)
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.
Description
Add
SOCK_CLOEXECand moveSOCK_NONBLOCK,SOL_SOCKET,SO_TYPEfrom the wasi-p2 module to the shared wasi module.In wasi-libc these are defined unconditionally for all WASI versions, not just wasip2.
Source: https://github.com/WebAssembly/wasi-libc/blob/f3e872871c6fb77db9727a18ab812a1a8f6e85ce/libc-bottom-half/headers/public/__header_sys_socket.h#L57-L62
Checklist
libc-test/semverhave been updatedPlaceholder or unstable values like*LASTor*MAXhave the standarddoc comment
cargo test -p libc-test --target mytarget);especially relevant for platforms that may not be checked in CI
Although the items were deleted from p2.rs and added to mod.rs, the public accessible constants for users targeting p2 were never changed, so I believe this can still be stable, but correct me if I'm wrong.
libc/src/wasi/mod.rs
Lines 1180 to 1185 in 63b34a9
@rustbot label +stable-nominated