]> Cypherpunks repositories - gostls13.git/commitdiff
all: update vendored dependencies for Go 1.17
authorAlexander Rakoczy <alex@golang.org>
Wed, 5 May 2021 14:48:13 +0000 (10:48 -0400)
committerAlexander Rakoczy <alex@golang.org>
Wed, 5 May 2021 15:53:03 +0000 (15:53 +0000)
The Go 1.17 freeze has begun. This is a time to update all
golang.org/x/...  module versions that contribute packages to the std
and cmd modules in the standard library to latest master versions.

updatestd --branch master --goroot=$HOME/development/goroot
> go version
go version devel go1.17-4c9791299d Wed May 5 09:00:06 2021 +0000 linux/amd64
> go env GOROOT
/home/rakoczy/development/goroot
> go version -m /home/rakoczy/go/bin/bundle
/home/rakoczy/go/bin/bundle: devel +c584f42dcf Tue Feb 23 18:39:53 2021 +0000
path golang.org/x/tools/cmd/bundle
mod golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY=
dep golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
dep golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4 h1:myAQVi0cGEoqQVR5POX+8RR2mrocKqNN1hmeMqhX27k=
dep golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=

skipping github.com/chzyer/logex (out of scope, it's not a golang.org/x dependency)
skipping github.com/chzyer/readline (out of scope, it's not a golang.org/x dependency)
skipping github.com/chzyer/test (out of scope, it's not a golang.org/x dependency)
skipping github.com/google/pprof (out of scope, it's not a golang.org/x dependency)
skipping github.com/ianlancetaylor/demangle (out of scope, it's not a golang.org/x dependency)
skipping github.com/yuin/goldmark (out of scope, it's not a golang.org/x dependency)
skipping rsc.io/pdf (out of scope, it's not a golang.org/x dependency)
updating module cmd in /home/rakoczy/development/goroot/src/cmd
> go mod edit -go=1.17
> go get -d golang.org/x/arch@cbf565b21d1e6f86b3114f28f516032b201c97fa golang.org/x/crypto@e9a32991a82ef02a1e74f495dcc0785239782bfe golang.org/x/mod@67f1c1edc27ada9b0cffe84ccdd4db2d4ff56edf golang.org/x/net@0287a6fb4125c2b83c66560a2677a4ee69a13903 golang.org/x/sync@036812b2e83c0ddf193dd5a34e034151da389d09 golang.org/x/sys@0981d6026fa6241c75c6949829b5bd7a2574ad55 golang.org/x/term@a79de5458b56c188f4fc267a58014ac25fec956a golang.org/x/text@5c7c50ebbd4f5b0d53b9b2fcdbeb92ffb732a06e golang.org/x/tools@7cab0ef2e9a592f6a73e7a1969ba89d38515e143 golang.org/x/xerrors@5ec99f83aff198f5fbd629d6c8d8eb38a04218ca
go: downloading golang.org/x/mod v0.4.3-0.20210504181020-67f1c1edc27a
go: downloading golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e
go: downloading golang.org/x/net v0.0.0-20210505024714-0287a6fb4125
go: downloading golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6
go: downloading golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f
go: downloading golang.org/x/tools v0.1.1-0.20210505014545-7cab0ef2e9a5
go get: upgraded golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 => v0.0.0-20210505024714-0287a6fb4125
go get: upgraded golang.org/x/sys v0.0.0-20210423082822-04245dca01da => v0.0.0-20210503173754-0981d6026fa6
go get: upgraded golang.org/x/text v0.3.3 => v0.3.7-0.20210503195748-5c7c50ebbd4f
go get: upgraded golang.org/x/tools v0.1.1-0.20210503200558-19b1717ea5eb => v0.1.1-0.20210505014545-7cab0ef2e9a5
> go mod tidy
> go mod vendor

updating module std in /home/rakoczy/development/goroot/src
> go mod edit -go=1.17
> go get -d golang.org/x/crypto@e9a32991a82ef02a1e74f495dcc0785239782bfe golang.org/x/net@0287a6fb4125c2b83c66560a2677a4ee69a13903 golang.org/x/sys@0981d6026fa6241c75c6949829b5bd7a2574ad55 golang.org/x/term@a79de5458b56c188f4fc267a58014ac25fec956a golang.org/x/text@5c7c50ebbd4f5b0d53b9b2fcdbeb92ffb732a06e golang.org/x/tools@7cab0ef2e9a592f6a73e7a1969ba89d38515e143
go get: upgraded golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 => v0.0.0-20210505024714-0287a6fb4125
go get: upgraded golang.org/x/sys v0.0.0-20210423082822-04245dca01da => v0.0.0-20210503173754-0981d6026fa6
go get: upgraded golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 => v0.0.0-20210503060354-a79de5458b56
go get: upgraded golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e => v0.1.1-0.20210505014545-7cab0ef2e9a5
> go mod tidy
> go mod vendor

updating bundles in /home/rakoczy/development/goroot/src
> go generate -run=bundle std cmd

For #36905

Change-Id: Ie145bba93125f0b4212df94216e05ec08c4fe534
Reviewed-on: https://go-review.googlesource.com/c/go/+/315831
Trust: Alexander Rakoczy <alex@golang.org>
Run-TryBot: Alexander Rakoczy <alex@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Heschi Kreinick <heschi@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

59 files changed:
src/cmd/go.mod
src/cmd/go.sum
src/cmd/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_386.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_amd64.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_arm.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_arm64.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
src/cmd/vendor/golang.org/x/sys/unix/asm_linux_s390x.s
src/cmd/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
src/cmd/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
src/cmd/vendor/golang.org/x/sys/unix/fdset.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_illumos.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_linux.go
src/cmd/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_386.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.1_13.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s
src/cmd/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go
src/cmd/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_linux.go
src/cmd/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go
src/cmd/vendor/modules.txt
src/go.mod
src/go.sum
src/net/http/h2_bundle.go
src/vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
src/vendor/golang.org/x/sys/cpu/cpu_arm64.s
src/vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
src/vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
src/vendor/golang.org/x/sys/cpu/cpu_s390x.s
src/vendor/golang.org/x/sys/cpu/cpu_x86.go
src/vendor/golang.org/x/sys/cpu/cpu_x86.s
src/vendor/modules.txt

index ebcfba62e5b60ff54d9df9ee2d0f6c8f2da4a1d6..a15cbe070ad5f0fbc606239547503aacf3eff544 100644 (file)
@@ -8,8 +8,8 @@ require (
        golang.org/x/arch v0.0.0-20210502124803-cbf565b21d1e
        golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e // indirect
        golang.org/x/mod v0.4.3-0.20210504181020-67f1c1edc27a
-       golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
+       golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 // indirect
        golang.org/x/term v0.0.0-20210503060354-a79de5458b56
-       golang.org/x/tools v0.1.1-0.20210503200558-19b1717ea5eb
+       golang.org/x/tools v0.1.1-0.20210505014545-7cab0ef2e9a5
        golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
 )
index 1f64b4aae3992425daf876590d20ebd2b35a417b..8a7ad4290abd81cdd2412a681e75f2e018603c8c 100644 (file)
@@ -12,11 +12,11 @@ golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5
 golang.org/x/mod v0.4.3-0.20210504181020-67f1c1edc27a h1:wbpC/7Wbo5WFVox32n+KjhRRLmTLq8YW/wRlL2iVAhk=
 golang.org/x/mod v0.4.3-0.20210504181020-67f1c1edc27a/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
 golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c=
+golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20210503060354-a79de5458b56 h1:b8jxX3zqjpqb2LklXPzKSGJhzyxCOZSz8ncv8Nv+y7w=
 golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
-golang.org/x/tools v0.1.1-0.20210503200558-19b1717ea5eb h1:6lugOWRUqRgNSUsUg8YnMqSUlUXSGsJG2dEv9T6BxwQ=
-golang.org/x/tools v0.1.1-0.20210503200558-19b1717ea5eb/go.mod h1:sH/Eidr0EddymY8HZSakBo32zU3fG5ovDq874hJLjVg=
+golang.org/x/tools v0.1.1-0.20210505014545-7cab0ef2e9a5 h1:ImcI7RFHWLu2QWpFDXaReu0j+sQAHIy65vUFZImXiqY=
+golang.org/x/tools v0.1.1-0.20210505014545-7cab0ef2e9a5/go.mod h1:sH/Eidr0EddymY8HZSakBo32zU3fG5ovDq874hJLjVg=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
 golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
index 6b4027b33fd241289973279c3f8a478326119008..db9171c2e4913da5a3e2fa1f18b3a3340b545913 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index 0655ecbfbbecb06edb5fec26a90f519402487b2c..8fd101d0716ddebfaa1ffcad73ccddd9e804bc9f 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index bc3fb6ac3ed2e86618f5818cbc9e0a6ae52a8392..7ed38e43c6735b4f1a3a30e31465894e45361606 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index 55b13c7ba45c493332a4ade1512fa83bc2800073..8ef1d51402ae919d60b0b01f8ba91c4ea7e1ca16 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index 22a83d8e3fad6cc2d199c73257082c7b193c0d06..98ae02760da1ee63ba1d10e52917ab5d3598741e 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && arm64 && gc
 // +build linux
 // +build arm64
 // +build gc
index dc222b90ce74f1f28d088efb0a1bcf2e581ee8ab..21231d2ce13f61be1682d6c8cf8f076e8d7e7f1d 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips64 || mips64le) && gc
 // +build linux
 // +build mips64 mips64le
 // +build gc
index d333f13cff3b76b94c7d2b6f29a5430049b79573..6783b26c606a5e6dee0043e357ee19dae78cf9d5 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips || mipsle) && gc
 // +build linux
 // +build mips mipsle
 // +build gc
index 459a629c2732faaa8fdd281740daa3d986910aba..19d4989344df7e2447524417b821f90b8793b0d4 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (ppc64 || ppc64le) && gc
 // +build linux
 // +build ppc64 ppc64le
 // +build gc
index 04d38497c6dda11c8121132be28880fe18d57611..e42eb81d583d3c6d4b29dc0daf00eb5cb51ac2dc 100644 (file)
@@ -2,7 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build riscv64,gc
+//go:build riscv64 && gc
+// +build riscv64
+// +build gc
 
 #include "textflag.h"
 
index cc303989e1741bdd169bf23f75702dd8a5b838d9..c46aab33959403e570d12f96be0d8a716c22da1d 100644 (file)
@@ -2,8 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build s390x
+//go:build linux && s390x && gc
 // +build linux
+// +build s390x
 // +build gc
 
 #include "textflag.h"
index 47c93fcb6c765985b12a1bd6b8801e40e167d3e5..5e7a1169c05dafca9fa580c92ede8a2a66e328fb 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index 1f2c755a72035ec05700b5ec59056e1c2a03e227..f8c5394c1a72080555932c905184666a10dd03db 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index b1e07b22023d48340669f7d5ec78f146f7fb9dfe..a8068f94f290c052eb8426a0748cbb293fd13728 100644 (file)
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
 
 package unix
 
index c5c58806ca86ebb2cd79e8eec6652a49d9aa50f5..8c535768352743581bf0de05566e7a84c8480de6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright 2009 The Go Authors. All rights reserved.
+// Copyright 2021 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -10,6 +10,8 @@
 package unix
 
 import (
+       "fmt"
+       "runtime"
        "unsafe"
 )
 
@@ -127,3 +129,50 @@ func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags
        }
        return retCl, retData, flags, nil
 }
+
+func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
+       return ioctlRet(fd, req, uintptr(arg))
+}
+
+func IoctlSetString(fd int, req uint, val string) error {
+       bs := make([]byte, len(val)+1)
+       copy(bs[:len(bs)-1], val)
+       err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
+       runtime.KeepAlive(&bs[0])
+       return err
+}
+
+// Lifreq Helpers
+
+func (l *Lifreq) SetName(name string) error {
+       if len(name) >= len(l.Name) {
+               return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
+       }
+       for i := range name {
+               l.Name[i] = int8(name[i])
+       }
+       return nil
+}
+
+func (l *Lifreq) SetLifruInt(d int) {
+       *(*int)(unsafe.Pointer(&l.Lifru[0])) = d
+}
+
+func (l *Lifreq) GetLifruInt() int {
+       return *(*int)(unsafe.Pointer(&l.Lifru[0]))
+}
+
+func IoctlLifreq(fd int, req uint, l *Lifreq) error {
+       return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
+}
+
+// Strioctl Helpers
+
+func (s *Strioctl) SetInt(i int) {
+       s.Len = int32(unsafe.Sizeof(i))
+       s.Dp = (*int8)(unsafe.Pointer(&i))
+}
+
+func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
+       return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
+}
index 4263953bee3cabc9744ce98a75aeac054ea7bb5e..2dd7c8e34a940fd17e902c321e8c898b94f86d4b 100644 (file)
@@ -1151,7 +1151,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
 func Accept(fd int) (nfd int, sa Sockaddr, err error) {
        var rsa RawSockaddrAny
        var len _Socklen = SizeofSockaddrAny
-       nfd, err = accept(fd, &rsa, &len)
+       // Try accept4 first for Android, then try accept for kernel older than 2.6.28
+       nfd, err = accept4(fd, &rsa, &len, 0)
+       if err == ENOSYS {
+               nfd, err = accept(fd, &rsa, &len)
+       }
        if err != nil {
                return
        }
index 13f58d2b2fbc656e30831b00ffd62bfc55fe5433..1ffd8bfcfb90b1319ea64a798086c7d87964f9d8 100644 (file)
@@ -222,6 +222,8 @@ func (cmsg *Cmsghdr) SetLen(length int) {
 //sys   Creat(path string, mode uint32) (fd int, err error) = SYS___CREAT_A
 //sys  Dup(oldfd int) (fd int, err error)
 //sys  Dup2(oldfd int, newfd int) (err error)
+//sys  Errno2() (er2 int) = SYS___ERRNO2
+//sys  Err2ad() (eadd *int) = SYS___ERR2AD
 //sys  Exit(code int)
 //sys  Fchdir(fd int) (err error)
 //sys  Fchmod(fd int, mode uint32) (err error)
@@ -245,10 +247,12 @@ func Fstat(fd int, stat *Stat_t) (err error) {
 //sys   Poll(fds []PollFd, timeout int) (n int, err error) = SYS_POLL
 //sys   Times(tms *Tms) (ticks uintptr, err error) = SYS_TIMES
 //sys   W_Getmntent(buff *byte, size int) (lastsys int, err error) = SYS_W_GETMNTENT
+//sys   W_Getmntent_A(buff *byte, size int) (lastsys int, err error) = SYS___W_GETMNTENT_A
 
-//sys   Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A
-//sys   Unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A
+//sys   mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) = SYS___MOUNT_A
+//sys   unmount(filesystem string, mtm int) (err error) = SYS___UMOUNT_A
 //sys   Chroot(path string) (err error) = SYS___CHROOT_A
+//sys   Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) = SYS_SELECT
 //sysnb Uname(buf *Utsname) (err error) = SYS___UNAME_A
 
 func Ptsname(fd int) (name string, err error) {
@@ -1779,3 +1783,47 @@ func SetNonblock(fd int, nonblocking bool) (err error) {
 func Exec(argv0 string, argv []string, envv []string) error {
        return syscall.Exec(argv0, argv, envv)
 }
+
+func Mount(source string, target string, fstype string, flags uintptr, data string) (err error) {
+       if needspace := 8 - len(fstype); needspace <= 0 {
+               fstype = fstype[:8]
+       } else {
+               fstype += "        "[:needspace]
+       }
+       return mount_LE(target, source, fstype, uint32(flags), int32(len(data)), data)
+}
+
+func Unmount(name string, mtm int) (err error) {
+       // mountpoint is always a full path and starts with a '/'
+       // check if input string is not a mountpoint but a filesystem name
+       if name[0] != '/' {
+               return unmount(name, mtm)
+       }
+       // treat name as mountpoint
+       b2s := func(arr []byte) string {
+               nulli := bytes.IndexByte(arr, 0)
+               if nulli == -1 {
+                       return string(arr)
+               } else {
+                       return string(arr[:nulli])
+               }
+       }
+       var buffer struct {
+               header W_Mnth
+               fsinfo [64]W_Mntent
+       }
+       fsCount, err := W_Getmntent_A((*byte)(unsafe.Pointer(&buffer)), int(unsafe.Sizeof(buffer)))
+       if err != nil {
+               return err
+       }
+       if fsCount == 0 {
+               return EINVAL
+       }
+       for i := 0; i < fsCount; i++ {
+               if b2s(buffer.fsinfo[i].Mountpoint[:]) == name {
+                       err = unmount(b2s(buffer.fsinfo[i].Fsname[:]), mtm)
+                       break
+               }
+       }
+       return err
+}
index 35de419c6dbb5aa48b24e561cf7612401df389f4..47572aaa690f28311c9014e402f98ee6296f6b14 100644 (file)
@@ -166,13 +166,16 @@ const (
        BPF_ALU64                                   = 0x7
        BPF_AND                                     = 0x50
        BPF_ARSH                                    = 0xc0
+       BPF_ATOMIC                                  = 0xc0
        BPF_B                                       = 0x10
        BPF_BUILD_ID_SIZE                           = 0x14
        BPF_CALL                                    = 0x80
+       BPF_CMPXCHG                                 = 0xf1
        BPF_DIV                                     = 0x30
        BPF_DW                                      = 0x18
        BPF_END                                     = 0xd0
        BPF_EXIT                                    = 0x90
+       BPF_FETCH                                   = 0x1
        BPF_FROM_BE                                 = 0x8
        BPF_FROM_LE                                 = 0x0
        BPF_FS_MAGIC                                = 0xcafe4a11
@@ -240,6 +243,7 @@ const (
        BPF_W                                       = 0x0
        BPF_X                                       = 0x8
        BPF_XADD                                    = 0xc0
+       BPF_XCHG                                    = 0xe1
        BPF_XOR                                     = 0xa0
        BRKINT                                      = 0x2
        BS0                                         = 0x0
@@ -490,9 +494,9 @@ const (
        DM_UUID_FLAG                                = 0x4000
        DM_UUID_LEN                                 = 0x81
        DM_VERSION                                  = 0xc138fd00
-       DM_VERSION_EXTRA                            = "-ioctl (2020-10-01)"
+       DM_VERSION_EXTRA                            = "-ioctl (2021-02-01)"
        DM_VERSION_MAJOR                            = 0x4
-       DM_VERSION_MINOR                            = 0x2b
+       DM_VERSION_MINOR                            = 0x2c
        DM_VERSION_PATCHLEVEL                       = 0x0
        DT_BLK                                      = 0x6
        DT_CHR                                      = 0x2
@@ -860,6 +864,7 @@ const (
        FS_IOC_GET_ENCRYPTION_KEY_STATUS            = 0xc080661a
        FS_IOC_GET_ENCRYPTION_POLICY_EX             = 0xc0096616
        FS_IOC_MEASURE_VERITY                       = 0xc0046686
+       FS_IOC_READ_VERITY_METADATA                 = 0xc0286687
        FS_IOC_REMOVE_ENCRYPTION_KEY                = 0xc0406618
        FS_IOC_REMOVE_ENCRYPTION_KEY_ALL_USERS      = 0xc0406619
        FS_KEY_DESCRIPTOR_SIZE                      = 0x8
@@ -875,6 +880,9 @@ const (
        FS_VERITY_FL                                = 0x100000
        FS_VERITY_HASH_ALG_SHA256                   = 0x1
        FS_VERITY_HASH_ALG_SHA512                   = 0x2
+       FS_VERITY_METADATA_TYPE_DESCRIPTOR          = 0x2
+       FS_VERITY_METADATA_TYPE_MERKLE_TREE         = 0x1
+       FS_VERITY_METADATA_TYPE_SIGNATURE           = 0x3
        FUTEXFS_SUPER_MAGIC                         = 0xbad1dea
        F_ADD_SEALS                                 = 0x409
        F_DUPFD                                     = 0x0
@@ -1673,6 +1681,10 @@ const (
        PERF_FLAG_PID_CGROUP                        = 0x4
        PERF_MAX_CONTEXTS_PER_STACK                 = 0x8
        PERF_MAX_STACK_DEPTH                        = 0x7f
+       PERF_MEM_BLK_ADDR                           = 0x4
+       PERF_MEM_BLK_DATA                           = 0x2
+       PERF_MEM_BLK_NA                             = 0x1
+       PERF_MEM_BLK_SHIFT                          = 0x28
        PERF_MEM_LOCK_LOCKED                        = 0x2
        PERF_MEM_LOCK_NA                            = 0x1
        PERF_MEM_LOCK_SHIFT                         = 0x18
@@ -1736,12 +1748,14 @@ const (
        PERF_RECORD_MISC_GUEST_USER                 = 0x5
        PERF_RECORD_MISC_HYPERVISOR                 = 0x3
        PERF_RECORD_MISC_KERNEL                     = 0x1
+       PERF_RECORD_MISC_MMAP_BUILD_ID              = 0x4000
        PERF_RECORD_MISC_MMAP_DATA                  = 0x2000
        PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT     = 0x1000
        PERF_RECORD_MISC_SWITCH_OUT                 = 0x2000
        PERF_RECORD_MISC_SWITCH_OUT_PREEMPT         = 0x4000
        PERF_RECORD_MISC_USER                       = 0x2
        PERF_SAMPLE_BRANCH_PLM_ALL                  = 0x7
+       PERF_SAMPLE_WEIGHT_TYPE                     = 0x1004000
        PIPEFS_MAGIC                                = 0x50495045
        PPC_CMM_MAGIC                               = 0xc7571590
        PPPIOCGNPMODE                               = 0xc008744c
@@ -1995,6 +2009,10 @@ const (
        RTCF_NAT                                    = 0x800000
        RTCF_VALVE                                  = 0x200000
        RTC_AF                                      = 0x20
+       RTC_FEATURE_ALARM                           = 0x0
+       RTC_FEATURE_ALARM_RES_MINUTE                = 0x1
+       RTC_FEATURE_CNT                             = 0x3
+       RTC_FEATURE_NEED_WEEK_DAY                   = 0x2
        RTC_IRQF                                    = 0x80
        RTC_MAX_FREQ                                = 0x2000
        RTC_PF                                      = 0x40
@@ -2068,6 +2086,7 @@ const (
        RTM_F_LOOKUP_TABLE                          = 0x1000
        RTM_F_NOTIFY                                = 0x100
        RTM_F_OFFLOAD                               = 0x4000
+       RTM_F_OFFLOAD_FAILED                        = 0x20000000
        RTM_F_PREFIX                                = 0x800
        RTM_F_TRAP                                  = 0x8000
        RTM_GETACTION                               = 0x32
index a508392d2582ad371cbe703c518c77124551343e..6d30e6fd846ae378e1dd4c94ce3c78876947cc9e 100644 (file)
@@ -212,6 +212,8 @@ const (
        PTRACE_POKE_SYSTEM_CALL          = 0x5008
        PTRACE_PROT                      = 0x15
        PTRACE_SINGLEBLOCK               = 0xc
+       PTRACE_SYSEMU                    = 0x1f
+       PTRACE_SYSEMU_SINGLESTEP         = 0x20
        PTRACE_TE_ABORT_RAND             = 0x5011
        PT_ACR0                          = 0x90
        PT_ACR1                          = 0x94
index 4e87b4bebd5f09e777fe21be666fe7ebfbd087d2..fc7d0506f6c02e984bafeaabcc18b3fe798280b5 100644 (file)
@@ -67,24 +67,43 @@ const (
        IPPORT_RESERVED                 = 1024
        IPPORT_USERRESERVED             = 5000
        IPPROTO_AH                      = 51
+       SOL_AH                          = 51
        IPPROTO_DSTOPTS                 = 60
+       SOL_DSTOPTS                     = 60
        IPPROTO_EGP                     = 8
+       SOL_EGP                         = 8
        IPPROTO_ESP                     = 50
+       SOL_ESP                         = 50
        IPPROTO_FRAGMENT                = 44
+       SOL_FRAGMENT                    = 44
        IPPROTO_GGP                     = 2
+       SOL_GGP                         = 2
        IPPROTO_HOPOPTS                 = 0
+       SOL_HOPOPTS                     = 0
        IPPROTO_ICMP                    = 1
+       SOL_ICMP                        = 1
        IPPROTO_ICMPV6                  = 58
+       SOL_ICMPV6                      = 58
        IPPROTO_IDP                     = 22
+       SOL_IDP                         = 22
        IPPROTO_IP                      = 0
+       SOL_IP                          = 0
        IPPROTO_IPV6                    = 41
+       SOL_IPV6                        = 41
        IPPROTO_MAX                     = 256
+       SOL_MAX                         = 256
        IPPROTO_NONE                    = 59
+       SOL_NONE                        = 59
        IPPROTO_PUP                     = 12
+       SOL_PUP                         = 12
        IPPROTO_RAW                     = 255
+       SOL_RAW                         = 255
        IPPROTO_ROUTING                 = 43
+       SOL_ROUTING                     = 43
        IPPROTO_TCP                     = 6
+       SOL_TCP                         = 6
        IPPROTO_UDP                     = 17
+       SOL_UDP                         = 17
        IPV6_ADDR_PREFERENCES           = 32
        IPV6_CHECKSUM                   = 19
        IPV6_DONTFRAG                   = 29
@@ -186,6 +205,7 @@ const (
        MTM_SYNCHONLY                   = 0x00000200
        MTM_REMOUNT                     = 0x00000100
        MTM_NOSECURITY                  = 0x00000080
+       NFDBITS                         = 0x20
        O_ACCMODE                       = 0x03
        O_APPEND                        = 0x08
        O_ASYNCSIG                      = 0x0200
@@ -359,6 +379,8 @@ const (
        S_IFMST                         = 0x00FF0000
        TCP_KEEPALIVE                   = 0x8
        TCP_NODELAY                     = 0x1
+       TCP_INFO                        = 0xb
+       TCP_USER_TIMEOUT                = 0x1
        TIOCGWINSZ                      = 0x4008a368
        TIOCSWINSZ                      = 0x8008a367
        TIOCSBRK                        = 0x2000a77b
index 00da1ebfca12f4b54e044c3e12e811408e50e6b0..1c73a1921d72a5d6bf468d06c0f603d9ef7596e5 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go 386
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.13
 // +build go1.13
 
 #include "textflag.h"
index 1c53979a101e840431c504c65e85978e579f3184..8cc7928d9294d81b6439f6790a006139233b72c7 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go 386
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.12
 // +build go1.12
 
 #include "textflag.h"
index d671e8311fa7bcfe7928f816b6031d3b93151a71..ab59833fcd28b8c7691672fc642ea73fa1bc9c15 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go amd64
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.13
 // +build go1.13
 
 #include "textflag.h"
index c77bd6e20bdcf7c1d5f14e85f53ac9efd8ffbabf..b8f316e676d5667cae45a2038b5bbbcbb2582198 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go amd64
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.12
 // +build go1.12
 
 #include "textflag.h"
index 488e55707ab18def273e19c72bfa1091853c2ba7..0cc80ad87ea2ad9b514a7e6da58a951ef9722d78 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go arm
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.13
 // +build go1.13
 
 #include "textflag.h"
index 5eec5f1d95347cd3ed4e7b54ff98218fcc8e318c..a99f9c1113e27adaa959457578c69227ebe13cc6 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go arm
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.12
 // +build go1.12
 
 #include "textflag.h"
index b29dabb0f0849ad22bf45e4741212f497aebe661..a5f96ffb07d33f9edd92276211de3f0cd76b3515 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go arm64
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.13
 // +build go1.13
 
 #include "textflag.h"
index 53c402bf68b5886a6e022f2142e83ce6a06419b6..e30a69740718547835585b4a1a40b34fab79781f 100644 (file)
@@ -1,6 +1,7 @@
 // go run mkasm_darwin.go arm64
 // Code generated by the command above; DO NOT EDIT.
 
+//go:build go1.12
 // +build go1.12
 
 #include "textflag.h"
index 8285ab8419e2fa344fa9e4d9b2a10a4c3ee506ee..f2079457c6b24a9de24fbfb3e05007f83c5b91d9 100644 (file)
@@ -364,6 +364,22 @@ func Dup2(oldfd int, newfd int) (err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
+func Errno2() (er2 int) {
+       uer2, _, _ := syscall_syscall(SYS___ERRNO2, 0, 0, 0)
+       er2 = int(uer2)
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Err2ad() (eadd *int) {
+       ueadd, _, _ := syscall_syscall(SYS___ERR2AD, 0, 0, 0)
+       eadd = (*int)(unsafe.Pointer(ueadd))
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
 func Exit(code int) {
        syscall_syscall(SYS_EXIT, uintptr(code), 0, 0)
        return
@@ -531,7 +547,18 @@ func W_Getmntent(buff *byte, size int) (lastsys int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Mount(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) {
+func W_Getmntent_A(buff *byte, size int) (lastsys int, err error) {
+       r0, _, e1 := syscall_syscall(SYS___W_GETMNTENT_A, uintptr(unsafe.Pointer(buff)), uintptr(size), 0)
+       lastsys = int(r0)
+       if e1 != 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func mount_LE(path string, filesystem string, fstype string, mtm uint32, parmlen int32, parm string) (err error) {
        var _p0 *byte
        _p0, err = BytePtrFromString(path)
        if err != nil {
@@ -561,7 +588,7 @@ func Mount(path string, filesystem string, fstype string, mtm uint32, parmlen in
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Unmount(filesystem string, mtm int) (err error) {
+func unmount(filesystem string, mtm int) (err error) {
        var _p0 *byte
        _p0, err = BytePtrFromString(filesystem)
        if err != nil {
@@ -1215,3 +1242,14 @@ func utimes(path string, timeval *[2]Timeval) (err error) {
        }
        return
 }
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Select(nmsgsfds int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (ret int, err error) {
+       r0, _, e1 := syscall_syscall6(SYS_SELECT, uintptr(nmsgsfds), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
+       ret = int(r0)
+       if e1 != 0 {
+               err = errnoErr(e1)
+       }
+       return
+}
index 8e5359713489047d8e187e1dd25cb33ef1c83877..fbc59b7fdd25a2a88ccee4d1dd1305599bd81a93 100644 (file)
@@ -438,4 +438,5 @@ const (
        SYS_FACCESSAT2                   = 439
        SYS_PROCESS_MADVISE              = 440
        SYS_EPOLL_PWAIT2                 = 441
+       SYS_MOUNT_SETATTR                = 442
 )
index d7dceb769b3f587442c36be74b56ab0d764b8c7c..04d16d771ef78caf3cc2d2f1408a7d95e769f218 100644 (file)
@@ -360,4 +360,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 04093a69fd8ab025a2ef78076012d78299b7afca..3b1c105137368fa3f450433d1abf6d198a12aab6 100644 (file)
@@ -402,4 +402,5 @@ const (
        SYS_FACCESSAT2                   = 439
        SYS_PROCESS_MADVISE              = 440
        SYS_EPOLL_PWAIT2                 = 441
+       SYS_MOUNT_SETATTR                = 442
 )
index 48f94f135d6dca6cb1790c541769e8eb0ce3d433..3198adcf77a12293da9d3f7c36953e9b89f42df1 100644 (file)
@@ -305,4 +305,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 499978c3e402b7c3d23f9fd5630d9c4811a90c64..c877ec6e682141bb281bb7ca70da999c07633960 100644 (file)
@@ -423,4 +423,5 @@ const (
        SYS_FACCESSAT2                   = 4439
        SYS_PROCESS_MADVISE              = 4440
        SYS_EPOLL_PWAIT2                 = 4441
+       SYS_MOUNT_SETATTR                = 4442
 )
index 10d1db2be0ce067d4845da3bdfc68f405351d5a1..b5f29037299aced96b2934dddd1e1dabd5cb6fa0 100644 (file)
@@ -353,4 +353,5 @@ const (
        SYS_FACCESSAT2             = 5439
        SYS_PROCESS_MADVISE        = 5440
        SYS_EPOLL_PWAIT2           = 5441
+       SYS_MOUNT_SETATTR          = 5442
 )
index 208d5dcd5a32b4f62e7856c7e8dd78dbcc0d010f..46077689ab1f02b2052cd0bdc7e90d82e3f3d784 100644 (file)
@@ -353,4 +353,5 @@ const (
        SYS_FACCESSAT2             = 5439
        SYS_PROCESS_MADVISE        = 5440
        SYS_EPOLL_PWAIT2           = 5441
+       SYS_MOUNT_SETATTR          = 5442
 )
index f8250602eb8edaf33f9cb46ba23865e73f776665..80e6696b39dbedf1960d311b56789e45e7ee67ef 100644 (file)
@@ -423,4 +423,5 @@ const (
        SYS_FACCESSAT2                   = 4439
        SYS_PROCESS_MADVISE              = 4440
        SYS_EPOLL_PWAIT2                 = 4441
+       SYS_MOUNT_SETATTR                = 4442
 )
index 7693656a6b456efe93f3353707c610c0ca26db8a..b9d697ffb1c019575b5471c80d4b122f6cfafd9a 100644 (file)
@@ -430,4 +430,5 @@ const (
        SYS_FACCESSAT2                   = 439
        SYS_PROCESS_MADVISE              = 440
        SYS_EPOLL_PWAIT2                 = 441
+       SYS_MOUNT_SETATTR                = 442
 )
index d5ed3ff5100e7bed0f3f35646ce91092a8c01b4a..08edc54d35de252cea6e9d3e83f8ddb94ae38a8d 100644 (file)
@@ -402,4 +402,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index e29b4424c2455e4e7800f3e23582f758712c2ce4..33b33b08342dc7b36788b424af71de25fdf07f66 100644 (file)
@@ -402,4 +402,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 41deed6c3a57f87c94a3f5edf3f7421afbef8655..66c8a8e09e1a0a90a87d33558556449858fde0bd 100644 (file)
@@ -304,4 +304,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 8e53a9e8ceb6a4e8b6f544845a941292655d6baa..aea5760cea26445a7d11806db1b893b4739906b6 100644 (file)
@@ -367,4 +367,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 596e5bc7d357c3f40c3f495bbdaa6b8e9a8d22b6..488ca848d17616111630e616e7f5c78750278a46 100644 (file)
@@ -381,4 +381,5 @@ const (
        SYS_FACCESSAT2             = 439
        SYS_PROCESS_MADVISE        = 440
        SYS_EPOLL_PWAIT2           = 441
+       SYS_MOUNT_SETATTR          = 442
 )
index 1137a5a1f4b5b71b934ec805108d14d8682e9730..236f37ef6f7ec7f5b3f587321dc2445e05c9bed1 100644 (file)
@@ -25,14 +25,14 @@ type strbuf struct {
        Buf    *int8
 }
 
-type strioctl struct {
+type Strioctl struct {
        Cmd    int32
        Timout int32
        Len    int32
        Dp     *int8
 }
 
-type lifreq struct {
+type Lifreq struct {
        Name   [32]int8
        Lifru1 [4]byte
        Type   uint32
index 3bfc6f7323b7d240073122e8c787ea44484f4890..087323591e61d8cbfc35732e935e4707e20f5237 100644 (file)
@@ -1016,7 +1016,10 @@ const (
        PERF_SAMPLE_PHYS_ADDR                 = 0x80000
        PERF_SAMPLE_AUX                       = 0x100000
        PERF_SAMPLE_CGROUP                    = 0x200000
-       PERF_SAMPLE_MAX                       = 0x1000000
+       PERF_SAMPLE_DATA_PAGE_SIZE            = 0x400000
+       PERF_SAMPLE_CODE_PAGE_SIZE            = 0x800000
+       PERF_SAMPLE_WEIGHT_STRUCT             = 0x1000000
+       PERF_SAMPLE_MAX                       = 0x2000000
        PERF_SAMPLE_BRANCH_USER_SHIFT         = 0x0
        PERF_SAMPLE_BRANCH_KERNEL_SHIFT       = 0x1
        PERF_SAMPLE_BRANCH_HV_SHIFT           = 0x2
@@ -3126,7 +3129,8 @@ const (
        DEVLINK_ATTR_REMOTE_RELOAD_STATS                   = 0xa1
        DEVLINK_ATTR_RELOAD_ACTION_INFO                    = 0xa2
        DEVLINK_ATTR_RELOAD_ACTION_STATS                   = 0xa3
-       DEVLINK_ATTR_MAX                                   = 0xa3
+       DEVLINK_ATTR_PORT_PCI_SF_NUMBER                    = 0xa4
+       DEVLINK_ATTR_MAX                                   = 0xa4
        DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE              = 0x0
        DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX           = 0x1
        DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT               = 0x0
@@ -3140,7 +3144,9 @@ const (
        DEVLINK_RESOURCE_UNIT_ENTRY                        = 0x0
        DEVLINK_PORT_FUNCTION_ATTR_UNSPEC                  = 0x0
        DEVLINK_PORT_FUNCTION_ATTR_HW_ADDR                 = 0x1
-       DEVLINK_PORT_FUNCTION_ATTR_MAX                     = 0x1
+       DEVLINK_PORT_FN_ATTR_STATE                         = 0x2
+       DEVLINK_PORT_FN_ATTR_OPSTATE                       = 0x3
+       DEVLINK_PORT_FUNCTION_ATTR_MAX                     = 0x3
 )
 
 type FsverityDigest struct {
@@ -3509,7 +3515,8 @@ const (
        ETHTOOL_A_LINKMODES_DUPLEX                = 0x6
        ETHTOOL_A_LINKMODES_MASTER_SLAVE_CFG      = 0x7
        ETHTOOL_A_LINKMODES_MASTER_SLAVE_STATE    = 0x8
-       ETHTOOL_A_LINKMODES_MAX                   = 0x8
+       ETHTOOL_A_LINKMODES_LANES                 = 0x9
+       ETHTOOL_A_LINKMODES_MAX                   = 0x9
        ETHTOOL_A_LINKSTATE_UNSPEC                = 0x0
        ETHTOOL_A_LINKSTATE_HEADER                = 0x1
        ETHTOOL_A_LINKSTATE_LINK                  = 0x2
index 8bffde78e58bd580a039bd395980eb0b3c40fb3c..4ab638cb94c7adc5570c342ff4398d40b899907d 100644 (file)
@@ -347,6 +347,10 @@ type Dirent struct {
        Name   [256]byte
 }
 
+type FdSet struct {
+       Bits [64]int32
+}
+
 // This struct is packed on z/OS so it can't be used directly.
 type Flock_t struct {
        Type   int16
index a5dd28b7dc7a6cfe91d75ea08c391e36eeab321d..6b19ec3aea1c458ef561cdced14cbc657789ecc3 100644 (file)
@@ -39,8 +39,8 @@ golang.org/x/mod/sumdb/dirhash
 golang.org/x/mod/sumdb/note
 golang.org/x/mod/sumdb/tlog
 golang.org/x/mod/zip
-# golang.org/x/sys v0.0.0-20210423082822-04245dca01da
-## explicit; go 1.12
+# golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6
+## explicit; go 1.17
 golang.org/x/sys/internal/unsafeheader
 golang.org/x/sys/plan9
 golang.org/x/sys/unix
@@ -48,7 +48,7 @@ golang.org/x/sys/windows
 # golang.org/x/term v0.0.0-20210503060354-a79de5458b56
 ## explicit; go 1.17
 golang.org/x/term
-# golang.org/x/tools v0.1.1-0.20210503200558-19b1717ea5eb
+# golang.org/x/tools v0.1.1-0.20210505014545-7cab0ef2e9a5
 ## explicit; go 1.17
 golang.org/x/tools/cover
 golang.org/x/tools/go/analysis
index 8402cf12aae1a03efdc2117ccaa0cd9ec6ba8375..a3ceb05890e30da4e8af632fd01b6f3c4513cf20 100644 (file)
@@ -4,7 +4,7 @@ go 1.17
 
 require (
        golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e
-       golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420
-       golang.org/x/sys v0.0.0-20210423082822-04245dca01da // indirect
+       golang.org/x/net v0.0.0-20210505024714-0287a6fb4125
+       golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 // indirect
        golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f // indirect
 )
index 5f93c1cd497cddfb301353317251a806c7553468..27513a350ddd1aadaeb55694bad59354129022c2 100644 (file)
@@ -1,8 +1,8 @@
 golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e h1:8foAy0aoO5GkqCvAEJ4VC4P3zksTg4X4aJCDpZzmgQI=
 golang.org/x/crypto v0.0.0-20210503195802-e9a32991a82e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420 h1:a8jGStKg0XqKDlKqjLrXn0ioF5MH36pT7Z0BRTqLhbk=
-golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da h1:b3NXsE2LusjYGGjL5bxEVZZORm/YEFFrWFjR8eFrw/c=
-golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/net v0.0.0-20210505024714-0287a6fb4125 h1:Ugb8sMTWuWRC3+sz5WeN/4kejDx9BvIwnPUiJBjJE+8=
+golang.org/x/net v0.0.0-20210505024714-0287a6fb4125/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6 h1:cdsMqa2nXzqlgs183pHxtvoVwU7CyzaCTAUOg94af4c=
+golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f h1:yQJrRE0hDxDFmZLlRaw+3vusO4fwNHgHIjUOMO7bHYI=
 golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
index ad311946d5d49c6b9a989e12c94fca5992d455fe..fd540ff255ef8efa3e1c129c6c8dca338f757f46 100644 (file)
@@ -755,61 +755,69 @@ func (p *http2clientConnPool) getClientConn(req *Request, addr string, dialOnMis
                // It gets its own connection.
                http2traceGetConn(req, addr)
                const singleUse = true
-               cc, err := p.t.dialClientConn(addr, singleUse)
+               cc, err := p.t.dialClientConn(req.Context(), addr, singleUse)
                if err != nil {
                        return nil, err
                }
                return cc, nil
        }
-       p.mu.Lock()
-       for _, cc := range p.conns[addr] {
-               if st := cc.idleState(); st.canTakeNewRequest {
-                       if p.shouldTraceGetConn(st) {
-                               http2traceGetConn(req, addr)
+       for {
+               p.mu.Lock()
+               for _, cc := range p.conns[addr] {
+                       if st := cc.idleState(); st.canTakeNewRequest {
+                               if p.shouldTraceGetConn(st) {
+                                       http2traceGetConn(req, addr)
+                               }
+                               p.mu.Unlock()
+                               return cc, nil
                        }
+               }
+               if !dialOnMiss {
                        p.mu.Unlock()
-                       return cc, nil
+                       return nil, http2ErrNoCachedConn
                }
-       }
-       if !dialOnMiss {
+               http2traceGetConn(req, addr)
+               call := p.getStartDialLocked(req.Context(), addr)
                p.mu.Unlock()
-               return nil, http2ErrNoCachedConn
+               <-call.done
+               if http2shouldRetryDial(call, req) {
+                       continue
+               }
+               return call.res, call.err
        }
-       http2traceGetConn(req, addr)
-       call := p.getStartDialLocked(addr)
-       p.mu.Unlock()
-       <-call.done
-       return call.res, call.err
 }
 
 // dialCall is an in-flight Transport dial call to a host.
 type http2dialCall struct {
-       _    http2incomparable
-       p    *http2clientConnPool
+       _ http2incomparable
+       p *http2clientConnPool
+       // the context associated with the request
+       // that created this dialCall
+       ctx  context.Context
        done chan struct{}    // closed when done
        res  *http2ClientConn // valid after done is closed
        err  error            // valid after done is closed
 }
 
 // requires p.mu is held.
-func (p *http2clientConnPool) getStartDialLocked(addr string) *http2dialCall {
+func (p *http2clientConnPool) getStartDialLocked(ctx context.Context, addr string) *http2dialCall {
        if call, ok := p.dialing[addr]; ok {
                // A dial is already in-flight. Don't start another.
                return call
        }
-       call := &http2dialCall{p: p, done: make(chan struct{})}
+       call := &http2dialCall{p: p, done: make(chan struct{}), ctx: ctx}
        if p.dialing == nil {
                p.dialing = make(map[string]*http2dialCall)
        }
        p.dialing[addr] = call
-       go call.dial(addr)
+       go call.dial(call.ctx, addr)
        return call
 }
 
 // run in its own goroutine.
-func (c *http2dialCall) dial(addr string) {
+func (c *http2dialCall) dial(ctx context.Context, addr string) {
        const singleUse = false // shared conn
-       c.res, c.err = c.p.t.dialClientConn(addr, singleUse)
+       c.res, c.err = c.p.t.dialClientConn(ctx, addr, singleUse)
        close(c.done)
 
        c.p.mu.Lock()
@@ -954,6 +962,31 @@ func (p http2noDialClientConnPool) GetClientConn(req *Request, addr string) (*ht
        return p.getClientConn(req, addr, http2noDialOnMiss)
 }
 
+// shouldRetryDial reports whether the current request should
+// retry dialing after the call finished unsuccessfully, for example
+// if the dial was canceled because of a context cancellation or
+// deadline expiry.
+func http2shouldRetryDial(call *http2dialCall, req *Request) bool {
+       if call.err == nil {
+               // No error, no need to retry
+               return false
+       }
+       if call.ctx == req.Context() {
+               // If the call has the same context as the request, the dial
+               // should not be retried, since any cancellation will have come
+               // from this request.
+               return false
+       }
+       if !errors.Is(call.err, context.Canceled) && !errors.Is(call.err, context.DeadlineExceeded) {
+               // If the call error is not because of a context cancellation or a deadline expiry,
+               // the dial should not be retried.
+               return false
+       }
+       // Only retry if the error is a context cancellation error or deadline expiry
+       // and the context associated with the call was canceled or expired.
+       return call.ctx.Err() != nil
+}
+
 // Buffer chunks are allocated from a pool to reduce pressure on GC.
 // The maximum wasted space per dataBuffer is 2x the largest size class,
 // which happens when the dataBuffer has multiple chunks and there is
@@ -7084,12 +7117,12 @@ func http2canRetryError(err error) bool {
        return false
 }
 
-func (t *http2Transport) dialClientConn(addr string, singleUse bool) (*http2ClientConn, error) {
+func (t *http2Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*http2ClientConn, error) {
        host, _, err := net.SplitHostPort(addr)
        if err != nil {
                return nil, err
        }
-       tconn, err := t.dialTLS()("tcp", addr, t.newTLSConfig(host))
+       tconn, err := t.dialTLS(ctx)("tcp", addr, t.newTLSConfig(host))
        if err != nil {
                return nil, err
        }
@@ -7110,34 +7143,28 @@ func (t *http2Transport) newTLSConfig(host string) *tls.Config {
        return cfg
 }
 
-func (t *http2Transport) dialTLS() func(string, string, *tls.Config) (net.Conn, error) {
+func (t *http2Transport) dialTLS(ctx context.Context) func(string, string, *tls.Config) (net.Conn, error) {
        if t.DialTLS != nil {
                return t.DialTLS
        }
-       return t.dialTLSDefault
-}
-
-func (t *http2Transport) dialTLSDefault(network, addr string, cfg *tls.Config) (net.Conn, error) {
-       cn, err := tls.Dial(network, addr, cfg)
-       if err != nil {
-               return nil, err
-       }
-       if err := cn.Handshake(); err != nil {
-               return nil, err
-       }
-       if !cfg.InsecureSkipVerify {
-               if err := cn.VerifyHostname(cfg.ServerName); err != nil {
+       return func(network, addr string, cfg *tls.Config) (net.Conn, error) {
+               dialer := &tls.Dialer{
+                       Config: cfg,
+               }
+               cn, err := dialer.DialContext(ctx, network, addr)
+               if err != nil {
                        return nil, err
                }
+               tlsCn := cn.(*tls.Conn) // DialContext comment promises this will always succeed
+               state := tlsCn.ConnectionState()
+               if p := state.NegotiatedProtocol; p != http2NextProtoTLS {
+                       return nil, fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", p, http2NextProtoTLS)
+               }
+               if !state.NegotiatedProtocolIsMutual {
+                       return nil, errors.New("http2: could not negotiate protocol mutually")
+               }
+               return cn, nil
        }
-       state := cn.ConnectionState()
-       if p := state.NegotiatedProtocol; p != http2NextProtoTLS {
-               return nil, fmt.Errorf("http2: unexpected ALPN protocol %q; want %q", p, http2NextProtoTLS)
-       }
-       if !state.NegotiatedProtocolIsMutual {
-               return nil, errors.New("http2: could not negotiate protocol mutually")
-       }
-       return cn, nil
 }
 
 // disableKeepAlives reports whether connections should be closed as
index 6b4027b33fd241289973279c3f8a478326119008..db9171c2e4913da5a3e2fa1f18b3a3340b545913 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index cfc08c979439d439fd691e0bd797a83d66bd52c7..c61f95a05a73c4a7b51ebf0c7f088d711514fb86 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index fa7cdb9bcd5fa46a70730c36e9502d5ab9b7393a..3298a87e98129347604f98f4f7ce08d7a40c23e1 100644 (file)
@@ -15,3 +15,7 @@ func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
 // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler
 // and in cpu_gccgo.c for gccgo.
 func xgetbv() (eax, edx uint32)
+
+// darwinSupportsAVX512 is implemented in cpu_x86.s for gc compiler
+// and in cpu_gccgo_x86.go for gccgo.
+func darwinSupportsAVX512() bool
index 8478a6d5979462fd559394927e483fd5c7dc5412..863d415ab4987c21623b1b873a80c902335e6c9e 100644 (file)
@@ -25,3 +25,9 @@ func xgetbv() (eax, edx uint32) {
        gccgoXgetbv(&a, &d)
        return a, d
 }
+
+// gccgo doesn't build on Darwin, per:
+// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
+func darwinSupportsAVX512() bool {
+       return false
+}
index 964946df9571bbb73233890ff02be94cfcb03227..96f81e20971705fd804cb4597f979fb4f5bcca89 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build gc
 // +build gc
 
 #include "textflag.h"
index fd380c0a713a0881512a7d4f714ec6e94b535b7b..54ca4667fb8ea05bc0965e04e631cbe52541ab09 100644 (file)
@@ -87,8 +87,14 @@ func archInit() {
                // Check if XMM and YMM registers have OS support.
                osSupportsAVX = isSet(1, eax) && isSet(2, eax)
 
-               // Check if OPMASK and ZMM registers have OS support.
-               osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
+               if runtime.GOOS == "darwin" {
+                       // Check darwin commpage for AVX512 support. Necessary because:
+                       // https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/osfmk/i386/fpu.c#L175-L201
+                       osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512()
+               } else {
+                       // Check if OPMASK and ZMM registers have OS support.
+                       osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
+               }
        }
 
        X86.HasAVX = isSet(28, ecx1) && osSupportsAVX
index 2f557a5887a4f0c0b35ec6dd46c59105b2c81bda..b748ba52f7cf55efe4775a78e8e98bfd8a6fff74 100644 (file)
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build (386 || amd64 || amd64p32) && gc
 // +build 386 amd64 amd64p32
 // +build gc
 
@@ -25,3 +26,27 @@ TEXT ·xgetbv(SB),NOSPLIT,$0-8
        MOVL AX, eax+0(FP)
        MOVL DX, edx+4(FP)
        RET
+
+// func darwinSupportsAVX512() bool
+TEXT ·darwinSupportsAVX512(SB), NOSPLIT, $0-1
+    MOVB    $0, ret+0(FP) // default to false
+#ifdef GOOS_darwin   // return if not darwin
+#ifdef GOARCH_amd64  // return if not amd64
+// These values from:
+// https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/osfmk/i386/cpu_capabilities.h
+#define commpage64_base_address         0x00007fffffe00000
+#define commpage64_cpu_capabilities64   (commpage64_base_address+0x010)
+#define commpage64_version              (commpage64_base_address+0x01E)
+#define hasAVX512F                      0x0000004000000000
+    MOVQ    $commpage64_version, BX
+    CMPW    (BX), $13  // cpu_capabilities64 undefined in versions < 13
+    JL      no_avx512
+    MOVQ    $commpage64_cpu_capabilities64, BX
+    MOVQ    $hasAVX512F, CX
+    TESTQ   (BX), CX
+    JZ      no_avx512
+    MOVB    $1, ret+0(FP)
+no_avx512:
+#endif
+#endif
+    RET
index 8658b7da15e11192f9a461f457eb003c179d3589..5b939af60dbad0cc33214adf4cfe90c8f5efaab2 100644 (file)
@@ -8,7 +8,7 @@ golang.org/x/crypto/curve25519
 golang.org/x/crypto/hkdf
 golang.org/x/crypto/internal/subtle
 golang.org/x/crypto/poly1305
-# golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420
+# golang.org/x/net v0.0.0-20210505024714-0287a6fb4125
 ## explicit; go 1.17
 golang.org/x/net/dns/dnsmessage
 golang.org/x/net/http/httpguts
@@ -18,8 +18,8 @@ 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-20210423082822-04245dca01da
-## explicit; go 1.12
+# golang.org/x/sys v0.0.0-20210503173754-0981d6026fa6
+## explicit; go 1.17
 golang.org/x/sys/cpu
 # golang.org/x/text v0.3.7-0.20210503195748-5c7c50ebbd4f
 ## explicit; go 1.17