aboutsummaryrefslogtreecommitdiff
path: root/src/syscall/dirent.go
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2023-07-07 16:49:15 -0400
committerThan McIntosh <thanm@google.com>2023-07-07 16:49:15 -0400
commit71aaa8bde1ba983894121987aaf09cb2012ab622 (patch)
tree12c26e401a50654e0d557b98b2136b18b5ee9d97 /src/syscall/dirent.go
parent3aba453b66371647dfad4e901fca578d2b564e09 (diff)
parent894d24d617bb72d6e1bed7b143f9f7a0ac16b844 (diff)
downloadgo-dev.inline.tar.gz
go-dev.inline.zip
[dev.inline] merge with master at 894d24d617dev.inline
Change-Id: I845eec08108c69228ebcba921f8a807a376d3fae
Diffstat (limited to 'src/syscall/dirent.go')
-rw-r--r--src/syscall/dirent.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/syscall/dirent.go b/src/syscall/dirent.go
index eee94bf73c..1a0f1eec11 100644
--- a/src/syscall/dirent.go
+++ b/src/syscall/dirent.go
@@ -6,7 +6,10 @@
package syscall
-import "unsafe"
+import (
+ "runtime"
+ "unsafe"
+)
// readInt returns the size-bytes unsigned integer in native byte order at offset off.
func readInt(b []byte, off, size uintptr) (u uint64, ok bool) {
@@ -75,7 +78,9 @@ func ParseDirent(buf []byte, max int, names []string) (consumed int, count int,
if !ok {
break
}
- if ino == 0 { // File absent in directory.
+ // See src/os/dir_unix.go for the reason why this condition is
+ // excluded on wasip1.
+ if ino == 0 && runtime.GOOS != "wasip1" { // File absent in directory.
continue
}
const namoff = uint64(unsafe.Offsetof(Dirent{}.Name))