-
Notifications
You must be signed in to change notification settings - Fork 52
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
Forbid fd_advise on directories #240
Conversation
This commit adds a check to `fd_advise`. If the fd is a directory, return `ebadf`. This brings uvwasi in line with Wasmtime's behavior. WASI folks have stated that fd_advise should not work on directories as this is a Linux-specific behavior.
abce2dd
to
d5af30f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems correct to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@yagehu can you take a look at the failure on Windows? |
I pushed a fix. Thanks! |
Sorry for the noise. I'll test on a Windows machine today and try again. |
I tested the commit on Win 11. It compiles and passes the fd_advise test. |
This commit adds a check to
fd_advise
. If the fd is a directory, returnebadf
. This brings uvwasi in line with Wasmtime's behavior. WASI folks have stated that fd_advise should not work on directories as this is a Linux-specific behavior.