diff options
Diffstat (limited to 'vendor/golang.org/x/sys/unix/mkpost.go')
-rw-r--r-- | vendor/golang.org/x/sys/unix/mkpost.go | 14 |
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 7e5c22c..9feddd0 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() { | |||
28 | if goarch == "" { | 28 | if goarch == "" { |
29 | goarch = os.Getenv("GOARCH") | 29 | goarch = os.Getenv("GOARCH") |
30 | } | 30 | } |
31 | // Check that we are using the new build system if we should be. | 31 | // Check that we are using the Docker-based build system if we should be. |
32 | if goos == "linux" && goarch != "sparc64" { | 32 | if goos == "linux" { |
33 | if os.Getenv("GOLANG_SYS_BUILD") != "docker" { | 33 | if os.Getenv("GOLANG_SYS_BUILD") != "docker" { |
34 | os.Stderr.WriteString("In the new build system, mkpost should not be called directly.\n") | 34 | os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n") |
35 | os.Stderr.WriteString("See README.md\n") | 35 | os.Stderr.WriteString("See README.md\n") |
36 | os.Exit(1) | 36 | os.Exit(1) |
37 | } | 37 | } |
@@ -46,6 +46,10 @@ func main() { | |||
46 | valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`) | 46 | valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`) |
47 | b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}")) | 47 | b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}")) |
48 | 48 | ||
49 | // Intentionally export __fds_bits field in FdSet | ||
50 | fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`) | ||
51 | b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}")) | ||
52 | |||
49 | // If we have empty Ptrace structs, we should delete them. Only s390x emits | 53 | // If we have empty Ptrace structs, we should delete them. Only s390x emits |
50 | // nonempty Ptrace structs. | 54 | // nonempty Ptrace structs. |
51 | ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) | 55 | ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`) |
@@ -65,6 +69,10 @@ func main() { | |||
65 | convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) | 69 | convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`) |
66 | b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) | 70 | b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte")) |
67 | 71 | ||
72 | // Convert [1024]int8 to [1024]byte in Ptmget members | ||
73 | convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`) | ||
74 | b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte")) | ||
75 | |||
68 | // Remove spare fields (e.g. in Statx_t) | 76 | // Remove spare fields (e.g. in Statx_t) |
69 | spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) | 77 | spareFieldsRegex := regexp.MustCompile(`X__spare\S*`) |
70 | b = spareFieldsRegex.ReplaceAll(b, []byte("_")) | 78 | b = spareFieldsRegex.ReplaceAll(b, []byte("_")) |