nodejs / uvwasi

WASI syscall API built atop libuv
MIT License
226 stars 51 forks source link

Forbid fd_advise on directories #240

Closed yagehu closed 9 months ago

yagehu commented 10 months ago

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.

mhdawson commented 10 months ago

@yagehu can you take a look at the failure on Windows?

yagehu commented 10 months ago

@yagehu can you take a look at the failure on Windows?

I pushed a fix. Thanks!

yagehu commented 10 months ago

Sorry for the noise. I'll test on a Windows machine today and try again.

yagehu commented 10 months ago

I tested the commit on Win 11. It compiles and passes the fd_advise test.