Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ioctl doesn't implement FIONREAD for wasi:socket handles #538

Open
pavelsavara opened this issue Sep 20, 2024 · 2 comments
Open

ioctl doesn't implement FIONREAD for wasi:socket handles #538

pavelsavara opened this issue Sep 20, 2024 · 2 comments

Comments

@pavelsavara
Copy link

switch (request) {
case FIONBIO: {
va_list ap;
va_start(ap, request);
socket->blocking = *va_arg(ap, const int *) ==
0;
va_end(ap);
return 0;
}
default:
// TODO wasi-sockets: anything else we should support?
errno = EINVAL;
return -1;
}

@abrown
Copy link
Collaborator

abrown commented Sep 20, 2024

cc: @badeend, @dicej

@badeend
Copy link
Contributor

badeend commented Sep 21, 2024

I think wasi-libc can implement it like:

return if state == TCP_SOCKET_STATE_CONNECTED && input_pollable.ready() { 8192 } else { 0 };

Some additional info: WebAssembly/wasi-sockets#17

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

No branches or pull requests

3 participants