Skip to content

[WASI] Implement sock_recv#449

Merged
ksh8281 merged 1 commit into
Samsung:mainfrom
hyraxbyerax:feat/sock_recv
Jul 24, 2026
Merged

[WASI] Implement sock_recv#449
ksh8281 merged 1 commit into
Samsung:mainfrom
hyraxbyerax:feat/sock_recv

Conversation

@hyraxbyerax

Copy link
Copy Markdown
Contributor

Summary

  • Implement sock_recv for WASI.

Changes

  • Add the sock_recv implementation.
  • Add WAST tests for sock_recv.

Testing

  • Run the WASI test suite and verify that all tests pass.
python3 tools/run-tests.py --engine ./out/release/x64/walrus wasi

@hyraxbyerax hyraxbyerax changed the title Implement WASI sock_recv [WASI] Implement sock_recv Jul 19, 2026
@clover2123

Copy link
Copy Markdown
Collaborator

Please merge commits using git rebase -i

@hyraxbyerax

Copy link
Copy Markdown
Contributor Author

I'll squash the three commits into a single commit shortly.

@hyraxbyerax
hyraxbyerax force-pushed the feat/sock_recv branch 4 times, most recently from a1e612b to 06f82cb Compare July 22, 2026 05:31
Comment thread src/wasi/WASI.cpp Outdated
Comment on lines +397 to +400
if (iovptr == nullptr || nread == nullptr || roflags == nullptr) {
result[0] = Value(WasiErrNo::inval);
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What if iovsLen==0 here?
I think that it's better to add iovsLen==0 condition to this if statement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a condition to check whether iovsLen == 0 in the if statement. Thanks for pointing it out!

Comment thread src/wasi/WASI.cpp Outdated
result[0] = Value(uvwasi_sock_recv(WASI::g_uvwasi, fd, iovs, iovsLen, flags, nread, roflags));
}


Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remove this empty line (only one empty line is enough)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the extra empty line. Thanks for the suggestion!

@hyraxbyerax
hyraxbyerax force-pushed the feat/sock_recv branch 5 times, most recently from 2393ccb to 5e55693 Compare July 23, 2026 07:39
@hyraxbyerax hyraxbyerax reopened this Jul 23, 2026

@clover2123 clover2123 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ksh8281
ksh8281 merged commit 182b5f2 into Samsung:main Jul 24, 2026
89 checks passed
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.

3 participants