Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Explicitly set listener FD to non-blocking mode#9

Open
rvolosatovs wants to merge 1 commit intodotnet:mainfrom
rvolosatovs:feat/non-blocking-listen
Open

Explicitly set listener FD to non-blocking mode#9
rvolosatovs wants to merge 1 commit intodotnet:mainfrom
rvolosatovs:feat/non-blocking-listen

Conversation

@rvolosatovs
Copy link

@rvolosatovs rvolosatovs commented Jan 25, 2023

Implementation assumes the listener to be in non-blocking mode (see errno !=__WASI_ERRNO_AGAIN check on L64), but it never actually ensures it is.

This commit changes that and ensures that the listener is non-blocking.

Refs bytecodealliance/wasmtime#5633

Implementation assumes the listener to be in non-blocking mode (see
`errno != __WASI_ERRNO_AGAIN` check on L64), but it never actually ensures it is.

This commit changes that and ensures that the listener is non-blocking.

Signed-off-by: Roman Volosatovs <roman@profian.com>
@rvolosatovs
Copy link
Author

rvolosatovs commented Jan 25, 2023

For the record, I have not actually tested this, but looks like fcntl is correctly handled by wasi-libc https://github.com/WebAssembly/wasi-libc/blob/659ff414560721b1660a19685110e484a081c3d4/libc-bottom-half/cloudlibc/src/libc/fcntl/fcntl.c#L18-L57 , so I would expect this to behave just like a usual C program would

@jarkkojs
Copy link

You could perhaps use https://man7.org/linux/man-pages/man3/strerror.3.html.

@rvolosatovs
Copy link
Author

rvolosatovs commented Jan 31, 2023

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants