Added sock_recv_msg, sock_send_msg - #118
Draft
sadhbh-c0d3 wants to merge 4 commits into
Draft
Conversation
sadhbh-c0d3
marked this pull request as draft
June 9, 2026 17:07
sadhbh-c0d3
marked this pull request as ready for review
June 9, 2026 18:20
sadhbh-c0d3
marked this pull request as draft
June 10, 2026 16:29
|
We'll keep this around for when we start implementing the syscalls properly in Wasmer. For now, since there is no full implementation, this PR should remain a draft. |
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
Adds POSIX
sendmsg()andrecvmsg()support on top of the new WASIXsock_send_msg/sock_recv_msgABI.The libc wrappers translate between POSIX
struct msghdrand the WASIX ABI shape:msg_iovmaps to WASIX iovecs,msg_namemaps to__wasi_addr_port_t,msg_controlmaps to a raw WASIX control-message buffer,cmsghdrlayout.The control-message translation currently recognizes
SOL_SOCKET + SCM_RIGHTSand represents it using the new WASIX control-message header/type definitions.Motivation
libuvand Node-style runtimes expect normal POSIXsendmsg()/recvmsg()behavior for IPC and socketpair paths. In particular, libuv uses these APIs for handle-passing paths such as cluster/process IPC.Before this change, WASIX libc did not expose a proper POSIX-compatible route for these calls. That forced higher layers to carry WASIX-specific workarounds or avoid normal libuv code paths.
Behavior
Payload-only
sendmsg()/recvmsg()now route through WASIX socket message syscalls.For ancillary data:
cmsghdrrecords;Actual descriptor passing depends on runtime support in Wasmer. Until that phase is complete, runtimes may still return unsupported for outgoing control data, but libc now has the correct ABI path and translation layer.