]> git.proxmox.com Git - wasi-libc.git/commit
If `fd_readdir` returns a zero inode, call `fstatat` to get the inode value. (#345)
authorDan Gohman <dev@sunfishcode.online>
Fri, 2 Dec 2022 01:44:22 +0000 (17:44 -0800)
committerGitHub <noreply@github.com>
Fri, 2 Dec 2022 01:44:22 +0000 (17:44 -0800)
commitbe1ffd6a9eba1704085987482557c2a32724227f
tree4d4db1442d7ce52e23ec36e43d773fb646ffa9eb
parentc718ee138b4e5341e3584ceaba45cb6b4588b10d
If `fd_readdir` returns a zero inode, call `fstatat` to get the inode value. (#345)

* If `fd_readdir` returns a zero inode, call `fstatat` to get the inode value.

On some systems, `fd_readdir` may not implement the `d_ino` field and
may set it to zero. When this happens, have wasi-libc call `fstatat` to
get the inode number.

See the discussion in
https://github.com/WebAssembly/wasi-filesystem/issues/65 for details.

* Update the `d_type` field too, in case it changes.
libc-bottom-half/cloudlibc/src/libc/dirent/readdir.c
libc-bottom-half/cloudlibc/src/libc/dirent/scandirat.c