]> Cypherpunks repositories - gostls13.git/commitdiff
syscall: export Fsid.X__val on s390x
authorMichael Munday <munday@ca.ibm.com>
Fri, 30 Sep 2016 15:12:01 +0000 (11:12 -0400)
committerMichael Munday <munday@ca.ibm.com>
Fri, 13 Jan 2017 19:31:47 +0000 (19:31 +0000)
mkpost.go replaces all variables prefixed with 'X_' with '_' on s390x
because most of them do not need to be exposed. X__val is being used
by a third party library so it turns out we do need to expose it on
s390x (it is already exposed on all other Linux architectures).

Fixes #17298 and updates #18632.

Change-Id: Ic03463229a5f75ca41a4a4b50300da4b4d892d45
Reviewed-on: https://go-review.googlesource.com/30130
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/syscall/mkpost.go
src/syscall/ztypes_linux_s390x.go

index 26aeec843f1599bf144259899b33d012561697e4..e75ba1502a94aadd8d461e9fe077efa3b56e500d 100644 (file)
@@ -18,6 +18,7 @@ import (
        "log"
        "os"
        "regexp"
+       "strings"
 )
 
 func main() {
@@ -38,10 +39,16 @@ 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.
+               s = strings.Replace(s, "X__val", "MKPOSTFSIDVAL", 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.
+               s = strings.Replace(s, "MKPOSTFSIDVAL", "X__val", 1)
+
                // Force the type of RawSockaddr.Data to [14]int8 to match
                // the existing gccgo API.
                re = regexp.MustCompile("(Data\\s+\\[14\\])uint8")
index cdde47863f7d584eebf9b84c321424908d3c5fa3..63c4a83b19cfe6efaf813818dc7da36a50701ad0 100644 (file)
@@ -140,7 +140,7 @@ type Dirent struct {
 }
 
 type Fsid struct {
-       _ [2]int32
+       X__val [2]int32
 }
 
 type Flock_t struct {