aboutsummaryrefslogtreecommitdiff
path: root/src/os/dir_unix.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/dir_unix.go')
-rw-r--r--src/os/dir_unix.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/os/dir_unix.go b/src/os/dir_unix.go
index 004b9fbb2b..266a78acaf 100644
--- a/src/os/dir_unix.go
+++ b/src/os/dir_unix.go
@@ -89,7 +89,11 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
if !ok {
break
}
- if ino == 0 {
+ // When building to wasip1, the host runtime might be running on Windows
+ // or might expose a remote file system which does not have the concept
+ // of inodes. Therefore, we cannot make the assumption that it is safe
+ // to skip entries with zero inodes.
+ if ino == 0 && runtime.GOOS != "wasip1" {
continue
}
const namoff = uint64(unsafe.Offsetof(syscall.Dirent{}.Name))