Skip to content

Conversation

@loganek
Copy link
Contributor

@loganek loganek commented Sep 28, 2022

The function was introduced to WASI about half a year ago after it already existed in WAMR.

It caused problems with compiling wasi_socket_ext.c with the wasi-sdk that already had this hostcall exported (wasi-sdk >= 15).

The approach we take is the following:

  • we update WASI interface to be compatible with the preview1
  • compilation with wasi_socket_ext.c supports both wasi_sdk >= 15 and wasi_sdk < 15 (although we intend to drop support for < 15 at one point of time)
  • we override accept() from wasi-libc - we do that because accept() in wasi-libc doesn't support returning address (as it doesn't have getpeername() implemented), so wasi_socket_ext.c offers more functionality right now

Resolves #1528

wasi_snapshot_preview1

The function was introduced to WASI about half a year ago after it already
existed in WAMR.

It caused problems with compiling `wasi_socket_ext.c` with the wasi-sdk
that already had this hostcall exported (wasi-sdk >= 15).

The approach we take is the following:
* we update WASI interface to be compatible with the preview1
* compilation with `wasi_socket_ext.c` supports both wasi_sdk >= 15 and wasi_sdk < 15 (although we intend to drop support for < 15 at one point of time)
* we override `accept()` from wasi-libc - we do that because `accept()` in `wasi-libc` doesn't support returning address (as it doesn't have `getpeername()` implemented), so `wasi_socket_ext.c` offers more functionality right now

[1] https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/witx/wasi_snapshot_preview1.witx
@loganek loganek changed the title Update __wasi_sock_accept signature to match wasi_snapshot_previev1 [1] Update __wasi_sock_accept signature to match wasi_snapshot_previev1 Sep 28, 2022
@loganek loganek changed the title Update __wasi_sock_accept signature to match wasi_snapshot_previev1 Update __wasi_sock_accept signature to match [wasi_snapshot_previev1](https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/witx/wasi_snapshot_preview1.witx) Sep 28, 2022
@loganek loganek changed the title Update __wasi_sock_accept signature to match [wasi_snapshot_previev1](https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/witx/wasi_snapshot_preview1.witx) Update __wasi_sock_accept signature to match wasi_snapshot_previev1 Sep 28, 2022
@wenyongh wenyongh merged commit c505da7 into bytecodealliance:main Sep 29, 2022
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…ytecodealliance#1531)

The function was introduced to WASI about half a year ago after it already
existed in WAMR.

It caused problems with compiling `wasi_socket_ext.c` with the wasi-sdk
that already had this hostcall exported (wasi-sdk >= 15).

The approach we take is the following:
- we update WASI interface to be compatible with the wasi_snapshot_preview1
- compilation with `wasi_socket_ext.c` supports both wasi_sdk >= 15 and wasi_sdk < 15
  (although we intend to drop support for < 15 at one point of time)
- we override `accept()` from wasi-libc - we do that because `accept()` in `wasi-libc`
  doesn't support returning address (as it doesn't have `getpeername()` implemented),
  so `wasi_socket_ext.c` offers more functionality right now

Resolves bytecodealliance#1167 and bytecodealliance#1528.

[1] https://github.com/WebAssembly/WASI/blob/main/phases/snapshot/witx/wasi_snapshot_preview1.witx
@loganek loganek deleted the loganek/update-accept branch June 10, 2024 12:48
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.

__wasi_socket_accept deceleration conflicted

2 participants