PR target/82112
[official-gcc.git] / libgo / go / syscall / syscall_dragonfly.go
blobc2fc67f44a7f769c6749be997bb3b5cbe7421fe1
1 // Copyright 2009,2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package syscall
7 import "unsafe"
9 func direntIno(buf []byte) (uint64, bool) {
10 return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
13 func direntReclen(buf []byte) (uint64, bool) {
14 namlen, ok := direntNamlen(buf)
15 if !ok {
16 return 0, false
18 return (16 + namlen + 1 + 7) & ^uint64(7), true
21 func direntNamlen(buf []byte) (uint64, bool) {
22 return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))