unix: export FdSet bits field on freebsd

After CL 136816 the bits member of the FdSet struct is no longer
exported. Make sure to retain it in mkpost.go and rename it to Bits
as on all other systems.

Change-Id: I860b307a80c7e29b4a75d9d916d879ee0a31c014
Reviewed-on: https://go-review.googlesource.com/c/149897
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Yuval Pavel Zholkover <paulzhol@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Tobias Klauser
2018-11-16 09:11:09 +00:00
committed by Tobias Klauser
parent 66b7b1311a
commit 5ac8a444bd
4 changed files with 7 additions and 3 deletions

View File

@@ -46,6 +46,10 @@ func main() {
valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
// Intentionally export __fds_bits field in FdSet
fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)
b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}"))
// If we have empty Ptrace structs, we should delete them. Only s390x emits
// nonempty Ptrace structs.
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)

View File

@@ -339,7 +339,7 @@ type Kevent_t struct {
}
type FdSet struct {
_ [32]uint32
Bits [32]uint32
}
const (

View File

@@ -337,7 +337,7 @@ type Kevent_t struct {
}
type FdSet struct {
_ [16]uint64
Bits [16]uint64
}
const (

View File

@@ -337,7 +337,7 @@ type Kevent_t struct {
}
type FdSet struct {
_ [32]uint32
Bits [32]uint32
}
const (