unix: update Darwin ztype files

The main effect is to change some fields of Statfs_t from arrays of int8
to arrays of byte. This makes the types of those fields correspond to the
types used on most other BSD systems.

Change-Id: If7e80fd53d6369a0f7c979c0bf36ffe530dc5d8d
Reviewed-on: https://go-review.googlesource.com/c/sys/+/259903
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
Ian Lance Taylor
2020-10-06 15:56:09 -07:00
parent 8445cc04cb
commit cec0259cc9
4 changed files with 29 additions and 52 deletions

View File

@@ -92,9 +92,9 @@ type Statfs_t struct {
Type uint32
Flags uint32
Fssubtype uint32
Fstypename [16]int8
Mntonname [1024]int8
Mntfromname [1024]int8
Fstypename [16]byte
Mntonname [1024]byte
Mntfromname [1024]byte
Reserved [8]uint32
}
@@ -305,7 +305,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@@ -348,7 +347,6 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Metric int32
}
@@ -369,7 +367,6 @@ type IfmaMsghdr2 struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Refcount int32
}
@@ -378,7 +375,6 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
Flags int32
Addrs int32
Pid int32
@@ -400,7 +396,8 @@ type RtMetrics struct {
Rtt uint32
Rttvar uint32
Pksent uint32
Filler [4]uint32
State uint32
Filler [3]uint32
}
const (

View File

@@ -70,7 +70,6 @@ type Stat_t struct {
Uid uint32
Gid uint32
Rdev int32
_ [4]byte
Atim Timespec
Mtim Timespec
Ctim Timespec
@@ -97,10 +96,11 @@ type Statfs_t struct {
Type uint32
Flags uint32
Fssubtype uint32
Fstypename [16]int8
Mntonname [1024]int8
Mntfromname [1024]int8
Reserved [8]uint32
Fstypename [16]byte
Mntonname [1024]byte
Mntfromname [1024]byte
Flags_ext uint32
Reserved [7]uint32
}
type Flock_t struct {
@@ -133,8 +133,7 @@ type Fbootstraptransfer_t struct {
type Log2phys_t struct {
Flags uint32
_ [8]byte
_ [8]byte
_ [16]byte
}
type Fsid struct {
@@ -225,10 +224,8 @@ type IPv6Mreq struct {
type Msghdr struct {
Name *byte
Namelen uint32
_ [4]byte
Iov *Iovec
Iovlen int32
_ [4]byte
Control *byte
Controllen uint32
Flags int32
@@ -313,7 +310,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@@ -356,7 +352,6 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Metric int32
}
@@ -377,7 +372,6 @@ type IfmaMsghdr2 struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Refcount int32
}
@@ -386,7 +380,6 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
Flags int32
Addrs int32
Pid int32
@@ -408,7 +401,8 @@ type RtMetrics struct {
Rtt uint32
Rttvar uint32
Pksent uint32
Filler [4]uint32
State uint32
Filler [3]uint32
}
const (
@@ -431,7 +425,6 @@ type BpfStat struct {
type BpfProgram struct {
Len uint32
_ [4]byte
Insns *BpfInsn
}
@@ -456,7 +449,6 @@ type Termios struct {
Cflag uint64
Lflag uint64
Cc [20]uint8
_ [4]byte
Ispeed uint64
Ospeed uint64
}

View File

@@ -1,6 +1,5 @@
// NOTE: cgo can't generate struct Stat_t and struct Statfs_t yet
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs types_darwin.go
// cgo -godefs types_darwin.go | go run mkpost.go
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build arm,darwin
@@ -31,7 +30,7 @@ type Timeval struct {
Usec int32
}
type Timeval32 [0]byte
type Timeval32 struct{}
type Rusage struct {
Utime Timeval
@@ -93,9 +92,9 @@ type Statfs_t struct {
Type uint32
Flags uint32
Fssubtype uint32
Fstypename [16]int8
Mntonname [1024]int8
Mntfromname [1024]int8
Fstypename [16]byte
Mntonname [1024]byte
Mntfromname [1024]byte
Reserved [8]uint32
}
@@ -306,7 +305,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@@ -349,7 +347,6 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Metric int32
}
@@ -370,7 +367,6 @@ type IfmaMsghdr2 struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Refcount int32
}
@@ -379,7 +375,6 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
Flags int32
Addrs int32
Pid int32
@@ -401,7 +396,8 @@ type RtMetrics struct {
Rtt uint32
Rttvar uint32
Pksent uint32
Filler [4]uint32
State uint32
Filler [3]uint32
}
const (

View File

@@ -70,7 +70,6 @@ type Stat_t struct {
Uid uint32
Gid uint32
Rdev int32
_ [4]byte
Atim Timespec
Mtim Timespec
Ctim Timespec
@@ -97,10 +96,11 @@ type Statfs_t struct {
Type uint32
Flags uint32
Fssubtype uint32
Fstypename [16]int8
Mntonname [1024]int8
Mntfromname [1024]int8
Reserved [8]uint32
Fstypename [16]byte
Mntonname [1024]byte
Mntfromname [1024]byte
Flags_ext uint32
Reserved [7]uint32
}
type Flock_t struct {
@@ -133,8 +133,7 @@ type Fbootstraptransfer_t struct {
type Log2phys_t struct {
Flags uint32
_ [8]byte
_ [8]byte
_ [16]byte
}
type Fsid struct {
@@ -225,10 +224,8 @@ type IPv6Mreq struct {
type Msghdr struct {
Name *byte
Namelen uint32
_ [4]byte
Iov *Iovec
Iovlen int32
_ [4]byte
Control *byte
Controllen uint32
Flags int32
@@ -313,7 +310,6 @@ type IfMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Data IfData
}
@@ -356,7 +352,6 @@ type IfaMsghdr struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Metric int32
}
@@ -377,7 +372,6 @@ type IfmaMsghdr2 struct {
Addrs int32
Flags int32
Index uint16
_ [2]byte
Refcount int32
}
@@ -386,7 +380,6 @@ type RtMsghdr struct {
Version uint8
Type uint8
Index uint16
_ [2]byte
Flags int32
Addrs int32
Pid int32
@@ -408,7 +401,8 @@ type RtMetrics struct {
Rtt uint32
Rttvar uint32
Pksent uint32
Filler [4]uint32
State uint32
Filler [3]uint32
}
const (
@@ -431,7 +425,6 @@ type BpfStat struct {
type BpfProgram struct {
Len uint32
_ [4]byte
Insns *BpfInsn
}
@@ -456,7 +449,6 @@ type Termios struct {
Cflag uint64
Lflag uint64
Cc [20]uint8
_ [4]byte
Ispeed uint64
Ospeed uint64
}