No test because I'm too lazy to figure out how to create such files.
Fixes #52259
Change-Id: I7a07f49993cf046888729e9206ed53dddcf9cb13
Reviewed-on: https://go-review.googlesource.com/c/go/+/399435
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
"time"
)
+// These constants aren't in the syscall package, which is frozen.
+// Values taken from golang.org/x/sys/unix.
+const (
+ _S_IFNAM = 0x5000
+ _S_IFDOOR = 0xd000
+ _S_IFPORT = 0xe000
+)
+
func fillFileStatFromSys(fs *fileStat, name string) {
fs.name = basename(name)
fs.size = fs.sys.Size
// nothing to do
case syscall.S_IFSOCK:
fs.mode |= ModeSocket
+ case _S_IFNAM, _S_IFDOOR, _S_IFPORT:
+ fs.mode |= ModeIrregular
}
if fs.sys.Mode&syscall.S_ISGID != 0 {
fs.mode |= ModeSetgid