Skip to content

Commit 01636cf

Browse files
Bryan C. Millsgopherbot
Bryan C. Mills
authored andcommitted
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 <[email protected]> Run-TryBot: Bryan Mills <[email protected]> Reviewed-by: Tobias Klauser <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Auto-Submit: Bryan Mills <[email protected]>
1 parent a37672b commit 01636cf

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

src/syscall/mkpost.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@ func main() {
4040
re = regexp.MustCompile("Pad_cgo[A-Za-z0-9_]*")
4141
s = re.ReplaceAllString(s, "_")
4242

43-
// We want to keep X__val in Fsid. Hide it and restore it later.
43+
// We want to keep the X_ fields that are already consistently exported
44+
// for the other linux GOARCH settings.
45+
// Hide them and restore later.
4446
s = strings.Replace(s, "X__val", "MKPOSTFSIDVAL", 1)
47+
s = strings.Replace(s, "X__ifi_pad", "MKPOSTIFIPAD", 1)
48+
s = strings.Replace(s, "X_f", "MKPOSTSYSINFOTF", 1)
4549

4650
// Replace other unwanted fields with blank identifiers.
4751
re = regexp.MustCompile("X_[A-Za-z0-9_]*")
4852
s = re.ReplaceAllString(s, "_")
4953

50-
// Restore X__val in Fsid.
54+
// Restore preserved fields.
5155
s = strings.Replace(s, "MKPOSTFSIDVAL", "X__val", 1)
56+
s = strings.Replace(s, "MKPOSTIFIPAD", "X__ifi_pad", 1)
57+
s = strings.Replace(s, "MKPOSTSYSINFOTF", "X_f", 1)
5258

5359
// Force the type of RawSockaddr.Data to [14]int8 to match
5460
// the existing gccgo API.

src/syscall/ztypes_linux_riscv64.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ type Sysinfo_t struct {
566566
Totalhigh uint64
567567
Freehigh uint64
568568
Unit uint32
569-
_ [0]uint8
569+
X_f [0]uint8
570570
_ [4]byte
571571
}
572572

src/syscall/ztypes_linux_s390x.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -449,12 +449,12 @@ type RtAttr struct {
449449
}
450450

451451
type IfInfomsg struct {
452-
Family uint8
453-
_ uint8
454-
Type uint16
455-
Index int32
456-
Flags uint32
457-
Change uint32
452+
Family uint8
453+
X__ifi_pad uint8
454+
Type uint16
455+
Index int32
456+
Flags uint32
457+
Change uint32
458458
}
459459

460460
type IfAddrmsg struct {
@@ -564,7 +564,7 @@ type Sysinfo_t struct {
564564
Totalhigh uint64
565565
Freehigh uint64
566566
Unit uint32
567-
_ [0]uint8
567+
X_f [0]uint8
568568
_ [4]byte
569569
}
570570

0 commit comments

Comments
 (0)