summaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/unix/mkpost.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/golang.org/x/sys/unix/mkpost.go')
-rw-r--r--vendor/golang.org/x/sys/unix/mkpost.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go
index 7e5c22c47..9feddd00c 100644
--- a/vendor/golang.org/x/sys/unix/mkpost.go
+++ b/vendor/golang.org/x/sys/unix/mkpost.go
@@ -28,10 +28,10 @@ func main() {
if goarch == "" {
goarch = os.Getenv("GOARCH")
}
- // Check that we are using the new build system if we should be.
- if goos == "linux" && goarch != "sparc64" {
+ // Check that we are using the Docker-based build system if we should be.
+ if goos == "linux" {
if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n")
+ os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n")
os.Stderr.WriteString("See README.md\n")
os.Exit(1)
}
@@ -46,6 +46,10 @@ func main() {
valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
+ // Intentionally export __fds_bits field in FdSet
+ fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)
+ b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}"))
+
// If we have empty Ptrace structs, we should delete them. Only s390x emits
// nonempty Ptrace structs.
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
@@ -65,6 +69,10 @@ 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 [1024]int8 to [1024]byte in Ptmget members
+ convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`)
+ b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte"))
+
// Remove spare fields (e.g. in Statx_t)
spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
b = spareFieldsRegex.ReplaceAll(b, []byte("_"))