mirror of
https://github.com/golang/sys.git
synced 2026-02-08 03:36:03 +03:00
unix: update openbsd Statfs_t fields
This changes some fields of openbsd 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 (Darwin, FreeBSD, NetBSD), and simplifies the conversion to Go string. Similar changes: CL 359674, CL 259903, CL 74331. Note that while this patches mkpost.go, the end result is obtained by manual editing of ztypes_openbsd_*.go files. The reasons for this are: 1. automatic regeneration (tried on openbsd 6.9 / amd64) brings in way too many changes (5 files changed, 193 insertions, 45 deletions). 2. I could not figure out how to run openbsd on non-amd64. Nevertheless, this change is sufficient, meaning if someone will actually end up regenerating these (see e.g. CL 347649) after this commit is merged, the fields will still be kept as arrays of byte. Change-Id: I4520889f11f6ac2d9befe17c7a77186198c08cd2 Reviewed-on: https://go-review.googlesource.com/c/sys/+/407195 Run-TryBot: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Ian Lance Taylor <iant@google.com> Reviewed-by: 谢致邦 <xiezhibang@gmail.com> Reviewed-by: Michael Knyszek <mknyszek@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
This commit is contained in:
committed by
Gopher Robot
parent
f9599da83c
commit
bc2c85ada1
@@ -101,9 +101,9 @@ func main() {
|
||||
convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
|
||||
b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
||||
|
||||
// Convert [n]int8 to [n]byte in Statvfs_t members to simplify
|
||||
// Convert [n]int8 to [n]byte in Statvfs_t and Statfs_t members to simplify
|
||||
// conversion to string.
|
||||
convertStatvfsRegex := regexp.MustCompile(`((Fstype|Mnton|Mntfrom)name)(\s+)\[(\d+)\]int8`)
|
||||
convertStatvfsRegex := regexp.MustCompile(`(([Ff]stype|[Mm]nton|[Mm]ntfrom)name|mntfromspec)(\s+)\[(\d+)\]int8`)
|
||||
b = convertStatvfsRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
|
||||
|
||||
// Convert []int8 to []byte in device mapper ioctl interface
|
||||
|
||||
@@ -94,10 +94,10 @@ type Statfs_t struct {
|
||||
F_namemax uint32
|
||||
F_owner uint32
|
||||
F_ctime uint64
|
||||
F_fstypename [16]int8
|
||||
F_mntonname [90]int8
|
||||
F_mntfromname [90]int8
|
||||
F_mntfromspec [90]int8
|
||||
F_fstypename [16]byte
|
||||
F_mntonname [90]byte
|
||||
F_mntfromname [90]byte
|
||||
F_mntfromspec [90]byte
|
||||
Pad_cgo_0 [2]byte
|
||||
Mount_info [160]byte
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ type Statfs_t struct {
|
||||
F_namemax uint32
|
||||
F_owner uint32
|
||||
F_ctime uint64
|
||||
F_fstypename [16]int8
|
||||
F_mntonname [90]int8
|
||||
F_mntfromname [90]int8
|
||||
F_mntfromspec [90]int8
|
||||
F_fstypename [16]byte
|
||||
F_mntonname [90]byte
|
||||
F_mntfromname [90]byte
|
||||
F_mntfromspec [90]byte
|
||||
_ [2]byte
|
||||
Mount_info [160]byte
|
||||
}
|
||||
|
||||
@@ -98,10 +98,10 @@ type Statfs_t struct {
|
||||
F_namemax uint32
|
||||
F_owner uint32
|
||||
F_ctime uint64
|
||||
F_fstypename [16]int8
|
||||
F_mntonname [90]int8
|
||||
F_mntfromname [90]int8
|
||||
F_mntfromspec [90]int8
|
||||
F_fstypename [16]byte
|
||||
F_mntonname [90]byte
|
||||
F_mntfromname [90]byte
|
||||
F_mntfromspec [90]byte
|
||||
_ [2]byte
|
||||
Mount_info [160]byte
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ type Statfs_t struct {
|
||||
F_namemax uint32
|
||||
F_owner uint32
|
||||
F_ctime uint64
|
||||
F_fstypename [16]int8
|
||||
F_mntonname [90]int8
|
||||
F_mntfromname [90]int8
|
||||
F_mntfromspec [90]int8
|
||||
F_fstypename [16]byte
|
||||
F_mntonname [90]byte
|
||||
F_mntfromname [90]byte
|
||||
F_mntfromspec [90]byte
|
||||
_ [2]byte
|
||||
Mount_info [160]byte
|
||||
}
|
||||
|
||||
@@ -94,10 +94,10 @@ type Statfs_t struct {
|
||||
F_namemax uint32
|
||||
F_owner uint32
|
||||
F_ctime uint64
|
||||
F_fstypename [16]int8
|
||||
F_mntonname [90]int8
|
||||
F_mntfromname [90]int8
|
||||
F_mntfromspec [90]int8
|
||||
F_fstypename [16]byte
|
||||
F_mntonname [90]byte
|
||||
F_mntfromname [90]byte
|
||||
F_mntfromspec [90]byte
|
||||
_ [2]byte
|
||||
Mount_info [160]byte
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user