]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: export X__ifi_pad and X_f on s390x and riscv64
authorBryan C. Mills <bcmills@google.com>
Wed, 14 Dec 2022 19:36:46 +0000 (14:36 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 25 Jan 2023 02:59:05 +0000 (02:59 +0000)
This brings the exported field names on these GOARCHes
in line with the other supported linux platforms.

Fixes #57313.

Change-Id: I2107a7116ba60dc0c0a27f776318e3eb69e51682
Reviewed-on: https://go-review.googlesource.com/c/go/+/457557
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/syscall/mkpost.go
src/syscall/ztypes_linux_riscv64.go
src/syscall/ztypes_linux_s390x.go

index 4f81b81b57e528891f211ebd5aee7ea3b2f23157..48d3511f5423bf3684f8692007f2077c289b8e1e 100644 (file)
@@ -40,15 +40,21 @@ func main() {
                re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*")
                s = re.ReplaceAllString(s, "_")
 
-               // We want to keep X__val in Fsid. Hide it and restore it later.
+               // We want to keep the X_ fields that are already consistently exported
+               // for the other linux GOARCH settings.
+               // Hide them and restore later.
                s = strings.Replace(s, "X__val", "MKPOSTFSIDVAL", 1)
+               s = strings.Replace(s, "X__ifi_pad", "MKPOSTIFIPAD", 1)
+               s = strings.Replace(s, "X_f", "MKPOSTSYSINFOTF", 1)
 
                // Replace other unwanted fields with blank identifiers.
                re = regexp.MustCompile("X_[A-Za-z0-9_]*")
                s = re.ReplaceAllString(s, "_")
 
-               // Restore X__val in Fsid.
+               // Restore preserved fields.
                s = strings.Replace(s, "MKPOSTFSIDVAL", "X__val", 1)
+               s = strings.Replace(s, "MKPOSTIFIPAD", "X__ifi_pad", 1)
+               s = strings.Replace(s, "MKPOSTSYSINFOTF", "X_f", 1)
 
                // Force the type of RawSockaddr.Data to [14]int8 to match
                // the existing gccgo API.
index 6ee71ebbdc9f6ecf8930f595d7b18c86b852769d..f6b9cede0e5ce6cd8dc49d06d6bf84d0ce62731a 100644 (file)
@@ -566,7 +566,7 @@ type Sysinfo_t struct {
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
-       _         [0]uint8
+       X_f       [0]uint8
        _         [4]byte
 }
 
index 91f5ceff201d5f87cae07c52d820d102089051df..b67877f065c82ba87d04260935309945aa95cc18 100644 (file)
@@ -449,12 +449,12 @@ type RtAttr struct {
 }
 
 type IfInfomsg struct {
-       Family uint8
-       _      uint8
-       Type   uint16
-       Index  int32
-       Flags  uint32
-       Change uint32
+       Family     uint8
+       X__ifi_pad uint8
+       Type       uint16
+       Index      int32
+       Flags      uint32
+       Change     uint32
 }
 
 type IfAddrmsg struct {
@@ -564,7 +564,7 @@ type Sysinfo_t struct {
        Totalhigh uint64
        Freehigh  uint64
        Unit      uint32
-       _         [0]uint8
+       X_f       [0]uint8
        _         [4]byte
 }