tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

syscall: add WASI `sock_accept`

Open rvolosatovs opened this issue 3 years ago • 5 comments

Extracted from #2748 This PR adds functionality to be able to call the syscall directly. #2748 uses this syscall to implement net.Listener for WASI

Note that this calls into WASI directly without using libc. Note, also that this syscall is similar to, but different from standard Linux accept{,4}

Refs https://github.com/WebAssembly/WASI/pull/458

rvolosatovs avatar Aug 07 '22 10:08 rvolosatovs

@aykevl @dgryski any update on this PR? Are there any concerns regarding the feature?

Is there any way I can assist in getting this reviewed?

rvolosatovs avatar Aug 22 '22 15:08 rvolosatovs

I'll try to take a look this week.

dgryski avatar Aug 22 '22 15:08 dgryski

@dgryski any chance to look at this? :smile_cat:

deadprogram avatar Aug 29 '22 11:08 deadprogram

maybe make a code comment about it being different than accept/4?

you could also cite the reference impl which seems to only pass only two values as flags: 0 or non block https://github.com/WebAssembly/wasi-libc/commit/63e4489d01ad0262d995c6d9a5f1a1bab719c917#diff-07a5fd5db4b7b518204f053b8fa5f30506522395b61764e5d804931346335725

codefromthecrypt avatar Sep 06 '22 10:09 codefromthecrypt

To be honest, I think it's better to do this directly in the net package. The syscall package is deprecated and frozen upstream, and this adds some unnecessary API surface that we will have to maintain.

aykevl avatar Sep 15 '22 13:09 aykevl

To be honest, I think it's better to do this directly in the net package. The syscall package is deprecated and frozen upstream, and this adds some unnecessary API surface that we will have to maintain.

Closing, will rework using suggested approach (in #2748)

rvolosatovs avatar Sep 26 '22 10:09 rvolosatovs