syscall: export X__ifi_pad and X_f on s390x and riscv64
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>
diff --git a/src/syscall/mkpost.go b/src/syscall/mkpost.go
index 4f81b81..48d3511 100644
--- a/src/syscall/mkpost.go
+++ b/src/syscall/mkpost.go
@@ -40,15 +40,21 @@
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.
diff --git a/src/syscall/ztypes_linux_riscv64.go b/src/syscall/ztypes_linux_riscv64.go
index 6ee71eb..f6b9ced 100644
--- a/src/syscall/ztypes_linux_riscv64.go
+++ b/src/syscall/ztypes_linux_riscv64.go
@@ -566,7 +566,7 @@
Totalhigh uint64
Freehigh uint64
Unit uint32
- _ [0]uint8
+ X_f [0]uint8
_ [4]byte
}
diff --git a/src/syscall/ztypes_linux_s390x.go b/src/syscall/ztypes_linux_s390x.go
index 91f5cef..b67877f 100644
--- a/src/syscall/ztypes_linux_s390x.go
+++ b/src/syscall/ztypes_linux_s390x.go
@@ -449,12 +449,12 @@
}
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 @@
Totalhigh uint64
Freehigh uint64
Unit uint32
- _ [0]uint8
+ X_f [0]uint8
_ [4]byte
}