Fix "PR c++/92804 ICE trying to use concept as a nested-name-specifier"
[official-gcc.git] / libgo / go / syscall / syscall_dragonfly.go
blob930bb46ee3cfe5a02c060b2747b73c5c0f8e4923
1 // Copyright 2009 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 (
8 "sync"
9 "unsafe"
12 // See version list in https://github.com/DragonFlyBSD/DragonFlyBSD/blob/master/sys/sys/param.h
13 var (
14 osreldateOnce sync.Once
15 osreldate uint32
18 // First __DragonFly_version after September 2019 ABI changes
19 // http://lists.dragonflybsd.org/pipermail/users/2019-September/358280.html
20 const _dragonflyABIChangeVersion = 500705
22 func supportsABI(ver uint32) bool {
23 osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
24 return osreldate >= ver
27 func direntIno(buf []byte) (uint64, bool) {
28 return readInt(buf, unsafe.Offsetof(Dirent{}.Fileno), unsafe.Sizeof(Dirent{}.Fileno))
31 func direntReclen(buf []byte) (uint64, bool) {
32 namlen, ok := direntNamlen(buf)
33 if !ok {
34 return 0, false
36 return (16 + namlen + 1 + 7) &^ 7, true
39 func direntNamlen(buf []byte) (uint64, bool) {
40 return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))