]> git.immae.eu Git - github/fretlink/terraform-provider-statuscake.git/blobdiff - vendor/golang.org/x/sys/unix/mkpost.go
Upgrade to 0.12
[github/fretlink/terraform-provider-statuscake.git] / vendor / golang.org / x / sys / unix / mkpost.go
index 7e5c22c47350590ddc4321c41a69ffec434ea6e4..9feddd00c4b4d018e68fed15380c2a3be4bcd17d 100644 (file)
@@ -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("_"))