Skip to content

Send recv msg wasi#6

Draft
sadhbh-c0d3 wants to merge 8 commits into
wasix-org:v1.xfrom
Anodized-Titanium:send-recv-msg-wasi
Draft

Send recv msg wasi#6
sadhbh-c0d3 wants to merge 8 commits into
wasix-org:v1.xfrom
Anodized-Titanium:send-recv-msg-wasi

Conversation

@sadhbh-c0d3

Copy link
Copy Markdown

Summary

Enable the normal POSIX sendmsg() / recvmsg() paths in libuv-wasix instead of compiling them out on WASI.

This lets libuv use the same IPC stream machinery on WASIX as it does on Unix-like platforms, including socketpair-based process/cluster IPC paths.

Motivation

libuv uses sendmsg() / recvmsg() for IPC streams and handle-passing paths. The WASI branch previously disabled those paths and returned ENOSYS, which meant readable IPC fds could wake correctly but libuv still refused to consume the payload.

This blocked Node/EdgeJS child-process and cluster-style IPC. In particular, the parent process could receive readiness for the child IPC channel, but uv__read() would fail before reading the message.

WASIX now has libc/runtime support for payload-only sendmsg() / recvmsg() via sock_send_msg / sock_recv_msg, so libuv should use the normal POSIX code path.

Changes

  • Remove WASI exclusions around the Unix sendmsg() / recvmsg() stream paths.
  • Let WASIX builds compile and use the same IPC stream read/write code as other Unix targets.
  • Keep IPC payload handling on the standard libuv path instead of WASIX-specific fallback behavior.

Context

This is part of the WASIX POSIX compatibility work for Node-style IPC:

  • wasix-witx defines the sock_send_msg / sock_recv_msg ABI;
  • wasix-libc translates POSIX sendmsg() / recvmsg() to that ABI;
  • Note ATM Wasmer implements payload-only runtime support;
  • this libuv change lets higher-level runtimes actually use that path.

Descriptor passing via SCM_RIGHTS is still phase 2 runtime work. This change enables the path and payload transfer; it does not by itself implement fd passing semantics.

Testing

Validated with EdgeJS/QuickJS WASIX IPC and cluster-focused tests, including the diagnostics-channel process IPC path that previously woke but failed to read the IPC payload.

@sadhbh-c0d3 sadhbh-c0d3 marked this pull request as draft June 10, 2026 16:30
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.

4 participants