]> Cypherpunks repositories - gostls13.git/commitdiff
all: update to current golang.org/x/sys revision
authorGuoqi Chen <chenguoqi@loongson.cn>
Wed, 15 Jun 2022 11:07:24 +0000 (19:07 +0800)
committerGopher Robot <gobot@golang.org>
Wed, 22 Jun 2022 16:47:18 +0000 (16:47 +0000)
go get -d golang.org/x/sys@6c1b26c55098eae66ce95ab7c3712ab6cbfff2b7
go mod tidy
go mod vendor

This fixes the problem of the second return value in syscall on linux/loong64.

Change-Id: I8018ae96f4e5ca9779b2c053cdccc6b2866bf0de
Reviewed-on: https://go-review.googlesource.com/c/go/+/412274
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

46 files changed:
src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_loong64.s
src/cmd/vendor/golang.org/x/sys/unix/ifreq_linux.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_solaris.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go
src/cmd/vendor/modules.txt
src/go.mod
src/go.sum
src/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.c
src/vendor/modules.txt

index 04c2523a094e2af8603f8b6e5cbf7525be3f3a74..8230a3e453170e11fb155f2abb5df9a153a69e74 100644 (file)
@@ -7,7 +7,7 @@ require (
        golang.org/x/arch v0.0.0-20220412001346-fc48f9fe4c15
        golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4
        golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
-       golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a
+       golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098
        golang.org/x/term v0.0.0-20220411215600-e5f449aeb171
        golang.org/x/tools v0.1.11-0.20220516163903-1e55371df567
 )
index fc81e159e51de37364c75a2041ba46782beee420..435c3cce3bf5187c7dec6fa74488dbfb50d244b7 100644 (file)
@@ -10,8 +10,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVD
 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29 h1:w8s32wxx3sY+OjLlv9qltkLU5yvJzxjjgiHWLjdIcw4=
 golang.org/x/sync v0.0.0-20220513210516-0976fa681c29/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
-golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXHCguynGhKjWVsIUt5cY=
-golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 h1:PgOr27OhUx2IRqGJ2RxAWI4dJQ7bi9cSrB82uzFzfUA=
+golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20220411215600-e5f449aeb171 h1:EH1Deb8WZJ0xc0WK//leUHXcX9aLE5SymusoTmMZye8=
 golang.org/x/term v0.0.0-20220411215600-e5f449aeb171/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
 golang.org/x/tools v0.1.11-0.20220516163903-1e55371df567 h1:MksUZ/zlU+pMbsq1Sw16gK6E1aWzD0rLE+eS2SxF24Y=
index 6abd48eef0df15081800bd3be2d5fa674b9dbaa9..565357288a81c1bc8d28c8d970af25160e2e399f 100644 (file)
@@ -30,7 +30,7 @@ TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
        MOVV    trap+0(FP), R11 // syscall entry
        SYSCALL
        MOVV    R4, r1+32(FP)
-       MOVV    R5, r2+40(FP)
+       MOVV    R0, r2+40(FP)   // r2 is not used. Always set to 0
        JAL     runtime·exitsyscall(SB)
        RET
 
@@ -50,5 +50,5 @@ TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
        MOVV    trap+0(FP), R11 // syscall entry
        SYSCALL
        MOVV    R4, r1+32(FP)
-       MOVV    R5, r2+40(FP)
+       MOVV    R0, r2+40(FP)   // r2 is not used. Always set to 0
        RET
index 934af313c32315263a07b02b761cca2c0c403195..15721a5104e4e6174b3549dd8167fb9c155d6ebe 100644 (file)
@@ -8,7 +8,6 @@
 package unix
 
 import (
-       "bytes"
        "unsafe"
 )
 
@@ -45,13 +44,7 @@ func NewIfreq(name string) (*Ifreq, error) {
 
 // Name returns the interface name associated with the Ifreq.
 func (ifr *Ifreq) Name() string {
-       // BytePtrToString requires a NULL terminator or the program may crash. If
-       // one is not present, just return the empty string.
-       if !bytes.Contains(ifr.raw.Ifrn[:], []byte{0x00}) {
-               return ""
-       }
-
-       return BytePtrToString(&ifr.raw.Ifrn[0])
+       return ByteSliceToString(ifr.raw.Ifrn[:])
 }
 
 // According to netdevice(7), only AF_INET addresses are returned for numerous
index 5c2003cec654d2df3dd383506d34b3a76188bb1e..932996c75b69aa3e93dcc31e55289eecea136e02 100644 (file)
@@ -618,6 +618,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sys  Getpriority(which int, who int) (n int, err error)
 //sysnb        Getrlimit(which int, lim *Rlimit) (err error)
 //sysnb        Getrusage(who int, rusage *Rusage) (err error)
+//sysnb        Getsid(pid int) (sid int, err error)
 //sysnb        Gettimeofday(tv *Timeval) (err error)
 //sysnb        Getuid() (uid int)
 //sys  Kill(pid int, signum syscall.Signal) (err error)
index 234fd4a5d1ade3e03178d040f1142ebeea6123d8..1b305fab1b8391bbfc232612edde0a08832146b1 100644 (file)
@@ -5,7 +5,7 @@
 // +build 386,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 _const.go
 
 package unix
 
index 58619b7589b0aa472621b9d5368d0498e67b2dd4..6bcdef5dd6bc0f68c9422cf25fb9140beac3d385 100644 (file)
@@ -5,7 +5,7 @@
 // +build amd64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 _const.go
 
 package unix
 
index 3a64ff59dcecf0a8be2ee6d1ee14dc6a95a107de..e65df0f8d193764174ebf82330732f917379e09c 100644 (file)
@@ -5,7 +5,7 @@
 // +build arm,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index abe0b925789f4d7153d6ac996e7a5805736f9421..c7021115aa986632d69f63b4721d55f8666a7b04 100644 (file)
@@ -5,7 +5,7 @@
 // +build arm64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
 
 package unix
 
index ebc5f3218e16b4719758737955338a5468696610..0d83a1cd45dbc423908562a99ae35972a4dbb8d3 100644 (file)
@@ -5,7 +5,7 @@
 // +build loong64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 14d7a84399de4b684f0862ac963936060a0174fd..7f44a495b7e699f7631cea5aadf8cd5b2fc531fd 100644 (file)
@@ -5,7 +5,7 @@
 // +build mips,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 99e7c4ac0b454949cd245fca9ef4b19f81265bf4..2f92b4e48ed7aacfd99d5761a665e02ef53e6835 100644 (file)
@@ -5,7 +5,7 @@
 // +build mips64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 496364c33cc6e2159e5502403b12be3bc8b1a73b..f5367a966b30b97dc534dad16f012767ce227142 100644 (file)
@@ -5,7 +5,7 @@
 // +build mips64le,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 3e40830857dd0f32114387a040354386933a3702..2e22337d7cff8924127710b08a3e81aab7f0aa78 100644 (file)
@@ -5,7 +5,7 @@
 // +build mipsle,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 1151a7dfab3379a9e872fa45012113639cac890d..858c4f30f5b516508db287bc368e9029afdd04e8 100644 (file)
@@ -5,7 +5,7 @@
 // +build ppc,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index ed17f249e758a317ea37a3f6dbcfc8dfd719a26d..af2a7ba6e61524efa950a0defd44f54929b15a8e 100644 (file)
@@ -5,7 +5,7 @@
 // +build ppc64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index d84a37c1ac23bb9b62089b64babbb6ac5a53eaea..eaa2eb8e2469bcd4ed6317be16ba9f3ed3f3250e 100644 (file)
@@ -5,7 +5,7 @@
 // +build ppc64le,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 5cafba83f6b49a9119043add3ba46d11f5ccde64..faaa9f06378bd084d02daf917eba13f0faa1fdf7 100644 (file)
@@ -5,7 +5,7 @@
 // +build riscv64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index 6d122da41c53c2deeb9fbb38d02332b1bc22665c..0d161f0b75fe17bd5c9957aa388f317e326241f7 100644 (file)
@@ -5,7 +5,7 @@
 // +build s390x,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char _const.go
 
 package unix
 
index 6bd19e51dbb9e47b0615b202518c01908bef8024..4fd497a3e39a91dd97446c2b3c46a6a199475ce3 100644 (file)
@@ -5,7 +5,7 @@
 // +build sparc64,linux
 
 // Code generated by cmd/cgo -godefs; DO NOT EDIT.
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/_const.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include _const.go
 
 package unix
 
index d12f4fbfea5f08bd19ceafcc46e773913c1005b7..fdf53f8daf3b54a7b139eccb207caeb4670e1cdd 100644 (file)
@@ -66,6 +66,7 @@ import (
 //go:cgo_import_dynamic libc_getpriority getpriority "libc.so"
 //go:cgo_import_dynamic libc_getrlimit getrlimit "libc.so"
 //go:cgo_import_dynamic libc_getrusage getrusage "libc.so"
+//go:cgo_import_dynamic libc_getsid getsid "libc.so"
 //go:cgo_import_dynamic libc_gettimeofday gettimeofday "libc.so"
 //go:cgo_import_dynamic libc_getuid getuid "libc.so"
 //go:cgo_import_dynamic libc_kill kill "libc.so"
@@ -202,6 +203,7 @@ import (
 //go:linkname procGetpriority libc_getpriority
 //go:linkname procGetrlimit libc_getrlimit
 //go:linkname procGetrusage libc_getrusage
+//go:linkname procGetsid libc_getsid
 //go:linkname procGettimeofday libc_gettimeofday
 //go:linkname procGetuid libc_getuid
 //go:linkname procKill libc_kill
@@ -339,6 +341,7 @@ var (
        procGetpriority,
        procGetrlimit,
        procGetrusage,
+       procGetsid,
        procGettimeofday,
        procGetuid,
        procKill,
@@ -1044,6 +1047,17 @@ func Getrusage(who int, rusage *Rusage) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func Getsid(pid int) (sid int, err error) {
+       r0, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGetsid)), 1, uintptr(pid), 0, 0, 0, 0, 0)
+       sid = int(r0)
+       if e1 != 0 {
+               err = e1
+       }
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Gettimeofday(tv *Timeval) (err error) {
        _, _, e1 := rawSysvicall6(uintptr(unsafe.Pointer(&procGettimeofday)), 1, uintptr(unsafe.Pointer(tv)), 0, 0, 0, 0, 0)
        if e1 != 0 {
index 5314092568f69d83835320dec75ce6ebc5a61846..4948362f2c2242c58605cfc8436844c69d43df78 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m32 linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build 386 && linux
index b02ab83dbd33ebe4fbf42a1a7d0e91e01fc676a5..f64345e0e2f3a4a1f910402a6fb5d4a215ccf630 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -m64 linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build amd64 && linux
index 9e6871d2e0457249f58b7d28ad44c4a8af5f43cb..72469c79e7500ff2ec493860f1e81351e4b64d78 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build arm && linux
index b732d12559ce4360f3cb18e3520fde6972b182fe..68f072283a07bb6ac32fb454a39c682a7612ca52 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build arm64 && linux
index 61fbb24f8d5771816ec8bc44a1885049f8ac2961..090ae46c6757ede1c8ef196c1f22aa1246257f68 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build loong64 && linux
index 5310f71ea56026eb7d4248e644b2c76bceec83c0..03604cca135a55054ecbc65cf68ddd56d1413c16 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build mips && linux
index 219bbb1267ddf3d6af9538c2e3b32a92760b782d..fe57a7b26539d604bad3e154cf7717c03925ec63 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build mips64 && linux
index be9432da54804075892eb87895c2e34c53e9eac4..3f0db4da81e7a8588761227b10b3fd34e8c41d19 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build mips64le && linux
index d0155a42e61e7ac9c052ad02ccaa5cae4369d1e5..70ecd3b239f871eec15543da700ce6f761502b49 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build mipsle && linux
index 01c17bcc6f9764dc5de33a6f1977d5104718b7c9..4e700120db906c846fed42be1d08618669456b71 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build ppc && linux
index 944a9c3c78fb9a3dd898d70a603c565bddbf28ac..34a57c69928d520dadc7f4f53cca2c887aa58294 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build ppc64 && linux
index 5d2c90e1ce3d7fbe339e245ff64eb29a57aece43..6b84a47296f6713e76b7155e1937df811fb6f861 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build ppc64le && linux
index e173cb51574d46486b26543242b60e531b20b027..c4a305fe2e7d606d33c8f2fc6b8d92fcc8e3fe2d 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build riscv64 && linux
index 6106715d5c60e780335026949c73c52e0217f46b..a1f1e4c9e18bc5191135de1893c6c6ff7f7fe2e0 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include -fsigned-char linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build s390x && linux
index ca7b37b4b57b8e874732e13573002e0a5550293d..df95ebf3a1b6ac996fd794a2e8972b8d75f798c4 100644 (file)
@@ -1,4 +1,4 @@
-// cgo -godefs -- -Wall -Werror -static -I/tmp/include /build/unix/linux/types.go | go run mkpost.go
+// cgo -godefs -- -Wall -Werror -static -I/tmp/include linux/types.go | go run mkpost.go
 // Code generated by the command above; see README.md. DO NOT EDIT.
 
 //go:build sparc64 && linux
index baf5fe650444612124aa6d4fed9d33bcbf4b7770..2ed718ca06a728fe64ae240ee485c1845c271dcc 100644 (file)
@@ -94,10 +94,10 @@ type Statfs_t struct {
        F_namemax     uint32
        F_owner       uint32
        F_ctime       uint64
-       F_fstypename  [16]int8
-       F_mntonname   [90]int8
-       F_mntfromname [90]int8
-       F_mntfromspec [90]int8
+       F_fstypename  [16]byte
+       F_mntonname   [90]byte
+       F_mntfromname [90]byte
+       F_mntfromspec [90]byte
        Pad_cgo_0     [2]byte
        Mount_info    [160]byte
 }
index e21ae8ecfa6f4fadc86458afd9613b6064d5af14..b4fb97ebe6504ee288fd1c9cc4a3e6a624234096 100644 (file)
@@ -96,10 +96,10 @@ type Statfs_t struct {
        F_namemax     uint32
        F_owner       uint32
        F_ctime       uint64
-       F_fstypename  [16]int8
-       F_mntonname   [90]int8
-       F_mntfromname [90]int8
-       F_mntfromspec [90]int8
+       F_fstypename  [16]byte
+       F_mntonname   [90]byte
+       F_mntfromname [90]byte
+       F_mntfromspec [90]byte
        _             [2]byte
        Mount_info    [160]byte
 }
index f190651cd96465f067437ffe276d0e3ed5816301..2c4675040ef34cfccab43dc913dd915ed53f4d34 100644 (file)
@@ -98,10 +98,10 @@ type Statfs_t struct {
        F_namemax     uint32
        F_owner       uint32
        F_ctime       uint64
-       F_fstypename  [16]int8
-       F_mntonname   [90]int8
-       F_mntfromname [90]int8
-       F_mntfromspec [90]int8
+       F_fstypename  [16]byte
+       F_mntonname   [90]byte
+       F_mntfromname [90]byte
+       F_mntfromspec [90]byte
        _             [2]byte
        Mount_info    [160]byte
 }
index 84747c582cfce6c72f1ef8021cbffecaae95e6f6..ddee0451470863ee5a9251df1e7f722c1ec5134d 100644 (file)
@@ -94,10 +94,10 @@ type Statfs_t struct {
        F_namemax     uint32
        F_owner       uint32
        F_ctime       uint64
-       F_fstypename  [16]int8
-       F_mntonname   [90]int8
-       F_mntfromname [90]int8
-       F_mntfromspec [90]int8
+       F_fstypename  [16]byte
+       F_mntonname   [90]byte
+       F_mntfromname [90]byte
+       F_mntfromspec [90]byte
        _             [2]byte
        Mount_info    [160]byte
 }
index ac5c8b6370b1f77819c0d86e7ac5d2a814a0b34e..eb13d4e8bfc2b2dc62501cb1dcb7cdaaed379be8 100644 (file)
@@ -94,10 +94,10 @@ type Statfs_t struct {
        F_namemax     uint32
        F_owner       uint32
        F_ctime       uint64
-       F_fstypename  [16]int8
-       F_mntonname   [90]int8
-       F_mntfromname [90]int8
-       F_mntfromspec [90]int8
+       F_fstypename  [16]byte
+       F_mntonname   [90]byte
+       F_mntfromname [90]byte
+       F_mntfromspec [90]byte
        _             [2]byte
        Mount_info    [160]byte
 }
index 1280a9e70163c67d92d41039d940c2a46b99e321..4e4b5b63433a7fe89ece8a9cccecb25df9a4892d 100644 (file)
@@ -40,7 +40,7 @@ golang.org/x/mod/zip
 # golang.org/x/sync v0.0.0-20220513210516-0976fa681c29
 ## explicit
 golang.org/x/sync/semaphore
-# golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a
+# golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098
 ## explicit; go 1.17
 golang.org/x/sys/internal/unsafeheader
 golang.org/x/sys/plan9
index 2b4d8b4b753803b76321cf2c6f9bec638cddb134..94380d656788f9dea3feae723b48e823c2ba9618 100644 (file)
@@ -8,6 +8,6 @@ require (
 )
 
 require (
-       golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a // indirect
+       golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 // indirect
        golang.org/x/text v0.3.8-0.20220509174342-b4bca84b0361 // indirect
 )
index 5c710268b856a06a1925acb067bd31a0cc3a7634..a54b0565bdc97c07703b3a7b543c0e7d8c4c6d52 100644 (file)
@@ -2,7 +2,7 @@ golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8 h1:y+mHpWoQJNAHt26Nhh6JP7
 golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/net v0.0.0-20220517181318-183a9ca12b87 h1:cCR+9mKLOGyX4Zx+uBZDXEDAQsvKQ/XbW4vreG5v1jU=
 golang.org/x/net v0.0.0-20220517181318-183a9ca12b87/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
-golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a h1:N2T1jUrTQE9Re6TFF5PhvEHXHCguynGhKjWVsIUt5cY=
-golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098 h1:PgOr27OhUx2IRqGJ2RxAWI4dJQ7bi9cSrB82uzFzfUA=
+golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.8-0.20220509174342-b4bca84b0361 h1:h+pU/hCb7sEApigI6eII3/Emx5ZHaFWS+nulUp0Az/k=
 golang.org/x/text v0.3.8-0.20220509174342-b4bca84b0361/go.mod h1:5O0TPrbzDRCcAYs9rc2W4CFPmVHJfNFe8tESfECPJPE=
index e363c7d1319782c7ea58c87367a4f99528ff4c32..a4605e6d12e897f8a22e1044c0a903cfcdf5c3de 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <cpuid.h>
 #include <stdint.h>
+#include <x86intrin.h>
 
 // Need to wrap __get_cpuid_count because it's declared as static.
 int
@@ -17,27 +18,21 @@ gccgoGetCpuidCount(uint32_t leaf, uint32_t subleaf,
        return __get_cpuid_count(leaf, subleaf, eax, ebx, ecx, edx);
 }
 
+#pragma GCC diagnostic ignored "-Wunknown-pragmas"
+#pragma GCC push_options
+#pragma GCC target("xsave")
+#pragma clang attribute push (__attribute__((target("xsave"))), apply_to=function)
+
 // xgetbv reads the contents of an XCR (Extended Control Register)
 // specified in the ECX register into registers EDX:EAX.
 // Currently, the only supported value for XCR is 0.
-//
-// TODO: Replace with a better alternative:
-//
-//     #include <xsaveintrin.h>
-//
-//     #pragma GCC target("xsave")
-//
-//     void gccgoXgetbv(uint32_t *eax, uint32_t *edx) {
-//       unsigned long long x = _xgetbv(0);
-//       *eax = x & 0xffffffff;
-//       *edx = (x >> 32) & 0xffffffff;
-//     }
-//
-// Note that _xgetbv is defined starting with GCC 8.
 void
 gccgoXgetbv(uint32_t *eax, uint32_t *edx)
 {
-       __asm("  xorl %%ecx, %%ecx\n"
-             "  xgetbv"
-           : "=a"(*eax), "=d"(*edx));
+       uint64_t v = _xgetbv(0);
+       *eax = v & 0xffffffff;
+       *edx = v >> 32;
 }
+
+#pragma clang attribute pop
+#pragma GCC pop_options
index d0fe779a5c821d69ed08320144a5883c9ab8d4b4..dfb87abf137cca90d9a2c46a4308c73f616ae65b 100644 (file)
@@ -19,7 +19,7 @@ golang.org/x/net/idna
 golang.org/x/net/lif
 golang.org/x/net/nettest
 golang.org/x/net/route
-# golang.org/x/sys v0.0.0-20220513210249-45d2b4557a2a
+# golang.org/x/sys v0.0.0-20220614162138-6c1b26c55098
 ## explicit; go 1.17
 golang.org/x/sys/cpu
 # golang.org/x/text v0.3.8-0.20220509174342-b4bca84b0361