dirent_solaris.go

 1//go:build solaris
 2
 3package dirent
 4
 5import (
 6	"os"
 7	"syscall"
 8	"unsafe"
 9)
10
11func direntIno(buf []byte) (uint64, bool) {
12	return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Ino), unsafe.Sizeof(syscall.Dirent{}.Ino))
13}
14
15func direntReclen(buf []byte) (uint64, bool) {
16	return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Reclen), unsafe.Sizeof(syscall.Dirent{}.Reclen))
17}
18
19func direntNamlen(buf []byte) (uint64, bool) {
20	reclen, ok := direntReclen(buf)
21	if !ok {
22		return 0, false
23	}
24	return reclen - uint64(unsafe.Offsetof(syscall.Dirent{}.Name)), true
25}
26
27func direntType(buf []byte) os.FileMode {
28	return ^os.FileMode(0) // unknown
29}