Browse Source

upgrade dependencies for 2.9 cycle

tags/v2.9.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
8218d1caab
100 changed files with 1375 additions and 488 deletions
  1. 4
    4
      go.mod
  2. 8
    0
      go.sum
  3. 0
    11
      vendor/github.com/golang-jwt/jwt/.travis.yml
  4. 8
    1
      vendor/github.com/golang-jwt/jwt/README.md
  5. 7
    0
      vendor/github.com/golang-jwt/jwt/VERSION_HISTORY.md
  6. 6
    12
      vendor/github.com/golang-jwt/jwt/ecdsa.go
  7. 24
    12
      vendor/github.com/golang-jwt/jwt/map_claims.go
  8. 2
    6
      vendor/github.com/golang-jwt/jwt/token.go
  9. 1
    0
      vendor/golang.org/x/crypto/sha3/keccakf_amd64.s
  10. 1
    0
      vendor/golang.org/x/crypto/sha3/sha3_s390x.s
  11. 1
    1
      vendor/golang.org/x/crypto/sha3/xor_generic.go
  12. 1
    0
      vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s
  13. 2
    3
      vendor/golang.org/x/sys/cpu/cpu.go
  14. 2
    0
      vendor/golang.org/x/sys/cpu/cpu_aix.go
  15. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_arm64.s
  16. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go
  17. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go
  18. 5
    0
      vendor/golang.org/x/sys/cpu/cpu_gc_x86.go
  19. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go
  20. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go
  21. 7
    0
      vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go
  22. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_linux.go
  23. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go
  24. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go
  25. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go
  26. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_mips64x.go
  27. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_mipsx.go
  28. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_other_arm.go
  29. 2
    2
      vendor/golang.org/x/sys/cpu/cpu_other_arm64.go
  30. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go
  31. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
  32. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_riscv64.go
  33. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_s390x.s
  34. 1
    0
      vendor/golang.org/x/sys/cpu/cpu_wasm.go
  35. 9
    2
      vendor/golang.org/x/sys/cpu/cpu_x86.go
  36. 25
    0
      vendor/golang.org/x/sys/cpu/cpu_x86.s
  37. 2
    2
      vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go
  38. 2
    2
      vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go
  39. 3
    3
      vendor/golang.org/x/sys/unix/README.md
  40. 2
    1
      vendor/golang.org/x/sys/unix/aliases.go
  41. 1
    0
      vendor/golang.org/x/sys/unix/asm_aix_ppc64.s
  42. 5
    5
      vendor/golang.org/x/sys/unix/asm_bsd_386.s
  43. 4
    4
      vendor/golang.org/x/sys/unix/asm_bsd_amd64.s
  44. 4
    5
      vendor/golang.org/x/sys/unix/asm_bsd_arm.s
  45. 4
    4
      vendor/golang.org/x/sys/unix/asm_bsd_arm64.s
  46. 0
    29
      vendor/golang.org/x/sys/unix/asm_darwin_386.s
  47. 0
    30
      vendor/golang.org/x/sys/unix/asm_darwin_arm64.s
  48. 0
    29
      vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
  49. 0
    29
      vendor/golang.org/x/sys/unix/asm_freebsd_386.s
  50. 0
    29
      vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s
  51. 0
    29
      vendor/golang.org/x/sys/unix/asm_freebsd_arm.s
  52. 0
    29
      vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s
  53. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_386.s
  54. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_amd64.s
  55. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_arm.s
  56. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_arm64.s
  57. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_mips64x.s
  58. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_mipsx.s
  59. 1
    0
      vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s
  60. 3
    1
      vendor/golang.org/x/sys/unix/asm_linux_riscv64.s
  61. 2
    1
      vendor/golang.org/x/sys/unix/asm_linux_s390x.s
  62. 0
    29
      vendor/golang.org/x/sys/unix/asm_netbsd_386.s
  63. 0
    29
      vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s
  64. 0
    29
      vendor/golang.org/x/sys/unix/asm_netbsd_arm.s
  65. 0
    29
      vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s
  66. 0
    29
      vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s
  67. 0
    29
      vendor/golang.org/x/sys/unix/asm_openbsd_arm.s
  68. 1
    0
      vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s
  69. 1
    0
      vendor/golang.org/x/sys/unix/asm_solaris_amd64.s
  70. 426
    0
      vendor/golang.org/x/sys/unix/asm_zos_s390x.s
  71. 1
    0
      vendor/golang.org/x/sys/unix/cap_freebsd.go
  72. 2
    1
      vendor/golang.org/x/sys/unix/constants.go
  73. 2
    2
      vendor/golang.org/x/sys/unix/dev_aix_ppc.go
  74. 2
    2
      vendor/golang.org/x/sys/unix/dev_aix_ppc64.go
  75. 29
    0
      vendor/golang.org/x/sys/unix/dev_zos.go
  76. 1
    0
      vendor/golang.org/x/sys/unix/dirent.go
  77. 1
    0
      vendor/golang.org/x/sys/unix/endian_big.go
  78. 1
    0
      vendor/golang.org/x/sys/unix/endian_little.go
  79. 2
    1
      vendor/golang.org/x/sys/unix/env_unix.go
  80. 221
    0
      vendor/golang.org/x/sys/unix/epoll_zos.go
  81. 1
    0
      vendor/golang.org/x/sys/unix/fcntl.go
  82. 2
    1
      vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go
  83. 2
    1
      vendor/golang.org/x/sys/unix/fdset.go
  84. 164
    0
      vendor/golang.org/x/sys/unix/fstatfs_zos.go
  85. 2
    2
      vendor/golang.org/x/sys/unix/gccgo.go
  86. 1
    0
      vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go
  87. 1
    0
      vendor/golang.org/x/sys/unix/ioctl.go
  88. 196
    0
      vendor/golang.org/x/sys/unix/ioctl_linux.go
  89. 74
    0
      vendor/golang.org/x/sys/unix/ioctl_zos.go
  90. 1
    13
      vendor/golang.org/x/sys/unix/mkall.sh
  91. 38
    3
      vendor/golang.org/x/sys/unix/mkerrors.sh
  92. 1
    0
      vendor/golang.org/x/sys/unix/pagesize_unix.go
  93. 12
    0
      vendor/golang.org/x/sys/unix/ptrace_darwin.go
  94. 12
    0
      vendor/golang.org/x/sys/unix/ptrace_ios.go
  95. 1
    0
      vendor/golang.org/x/sys/unix/race.go
  96. 2
    1
      vendor/golang.org/x/sys/unix/race0.go
  97. 1
    0
      vendor/golang.org/x/sys/unix/readdirent_getdents.go
  98. 1
    0
      vendor/golang.org/x/sys/unix/readdirent_getdirentries.go
  99. 2
    1
      vendor/golang.org/x/sys/unix/sockcmsg_unix.go
  100. 0
    0
      vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go

+ 4
- 4
go.mod View File

@@ -11,7 +11,7 @@ require (
11 11
 	github.com/ergochat/irc-go v0.0.0-20210617222258-256f1601d3ce
12 12
 	github.com/go-sql-driver/mysql v1.6.0
13 13
 	github.com/go-test/deep v1.0.6 // indirect
14
-	github.com/golang-jwt/jwt v3.2.1+incompatible
14
+	github.com/golang-jwt/jwt v3.2.2+incompatible
15 15
 	github.com/gorilla/websocket v1.4.2
16 16
 	github.com/okzk/sdnotify v0.0.0-20180710141335-d9becc38acbd
17 17
 	github.com/onsi/ginkgo v1.12.0 // indirect
@@ -20,8 +20,8 @@ require (
20 20
 	github.com/tidwall/buntdb v1.2.7
21 21
 	github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208
22 22
 	github.com/xdg-go/scram v1.0.2
23
-	golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc
24
-	golang.org/x/text v0.3.6
23
+	golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8
24
+	golang.org/x/text v0.3.7
25 25
 	gopkg.in/yaml.v2 v2.4.0
26 26
 )
27 27
 
@@ -34,7 +34,7 @@ require (
34 34
 	github.com/tidwall/rtred v0.1.2 // indirect
35 35
 	github.com/tidwall/tinyqueue v0.1.1 // indirect
36 36
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
37
-	golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
37
+	golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
38 38
 	golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
39 39
 )
40 40
 

+ 8
- 0
go.sum View File

@@ -23,6 +23,8 @@ github.com/go-test/deep v1.0.6 h1:UHSEyLZUwX9Qoi99vVwvewiMC8mM2bf7XEM2nqvzEn8=
23 23
 github.com/go-test/deep v1.0.6/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
24 24
 github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c=
25 25
 github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
26
+github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
27
+github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
26 28
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
27 29
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
28 30
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
@@ -78,6 +80,8 @@ github.com/xdg-go/stringprep v1.0.2 h1:6iq84/ryjjeRmMJwxutI51F2GIPlP5BfTvXHeYjyh
78 80
 github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
79 81
 golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc h1:+q90ECDSAQirdykUN6sPEiBXBsp8Csjcca8Oy7bgLTA=
80 82
 golang.org/x/crypto v0.0.0-20210415154028-4f45737414dc/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
83
+golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8 h1:5QRxNnVsaJP6NAse0UdkRgL3zHMvCRRkrDVLNdNpdy4=
84
+golang.org/x/crypto v0.0.0-20211115234514-b4de73f9ece8/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
81 85
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
82 86
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110 h1:qWPm9rbaAMKs8Bq/9LRpbMqxWRVUAQwMI9fVrssnTfw=
83 87
 golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
@@ -86,6 +90,8 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h
86 90
 golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
87 91
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 h1:nxC68pudNYkKU6jWhgrqdreuFiOQWj1Fs7T3VrH4Pjw=
88 92
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
93
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4=
94
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
89 95
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
90 96
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
91 97
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
@@ -93,6 +99,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
93 99
 golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
94 100
 golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
95 101
 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
102
+golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
103
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
96 104
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
97 105
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc=
98 106
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

+ 0
- 11
vendor/github.com/golang-jwt/jwt/.travis.yml View File

@@ -1,11 +0,0 @@
1
-language: go
2
-
3
-script:
4
-    - go vet ./...
5
-    - go test -v ./...
6
-
7
-go:
8
-  - 1.7
9
-  - 1.8
10
-  - 1.9
11
-  - 1.10

+ 8
- 1
vendor/github.com/golang-jwt/jwt/README.md View File

@@ -9,10 +9,17 @@ A [go](http://www.golang.org) (or 'golang' for search engine friendliness) imple
9 9
 
10 10
 Future releases will be using the `github.com/golang-jwt/jwt` import path and continue the existing versioning scheme of `v3.x.x+incompatible`. Backwards-compatible patches and fixes will be done on the `v3` release branch, where as new build-breaking features will be developed in a `v4` release, possibly including a SIV-style import path.
11 11
 
12
-**SECURITY NOTICE:** Some older versions of Go have a security issue in the crypto/elliptic. Recommendation is to upgrade to at least 1.8.3. See issue [dgrijalva/jwt-go#216](https://github.com/dgrijalva/jwt-go/issues/216) for more detail.
12
+**SECURITY NOTICE:** Some older versions of Go have a security issue in the crypto/elliptic. Recommendation is to upgrade to at least 1.15 See issue [dgrijalva/jwt-go#216](https://github.com/dgrijalva/jwt-go/issues/216) for more detail.
13 13
 
14 14
 **SECURITY NOTICE:** It's important that you [validate the `alg` presented is what you expect](https://auth0.com/blog/critical-vulnerabilities-in-json-web-token-libraries/). This library attempts to make it easy to do the right thing by requiring key types match the expected alg, but you should take the extra step to verify it in your usage.  See the examples provided.
15 15
 
16
+### Supported Go versions
17
+
18
+Our support of Go versions is aligned with Go's [version release policy](https://golang.org/doc/devel/release#policy).
19
+So we will support a major version of Go until there are two newer major releases.
20
+We no longer support building jwt-go with unsupported Go versions, as these contain security vulnerabilities
21
+which will not be fixed.
22
+
16 23
 ## What the heck is a JWT?
17 24
 
18 25
 JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens.

+ 7
- 0
vendor/github.com/golang-jwt/jwt/VERSION_HISTORY.md View File

@@ -1,5 +1,12 @@
1 1
 ## `jwt-go` Version History
2 2
 
3
+#### 3.2.2
4
+
5
+* Starting from this release, we are adopting the policy to support the most 2 recent versions of Go currently available. By the time of this release, this is Go 1.15 and 1.16 ([#28](https://github.com/golang-jwt/jwt/pull/28)).
6
+* Fixed a potential issue that could occur when the verification of `exp`, `iat` or `nbf` was not required and contained invalid contents, i.e. non-numeric/date. Thanks for @thaJeztah for making us aware of that and @giorgos-f3 for originally reporting it to the formtech fork ([#40](https://github.com/golang-jwt/jwt/pull/40)).
7
+* Added support for EdDSA / ED25519 ([#36](https://github.com/golang-jwt/jwt/pull/36)).
8
+* Optimized allocations ([#33](https://github.com/golang-jwt/jwt/pull/33)).
9
+
3 10
 #### 3.2.1
4 11
 
5 12
 * **Import Path Change**: See MIGRATION_GUIDE.md for tips on updating your code

+ 6
- 12
vendor/github.com/golang-jwt/jwt/ecdsa.go View File

@@ -128,18 +128,12 @@ func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string
128 128
 			keyBytes += 1
129 129
 		}
130 130
 
131
-		// We serialize the outpus (r and s) into big-endian byte arrays and pad
132
-		// them with zeros on the left to make sure the sizes work out. Both arrays
133
-		// must be keyBytes long, and the output must be 2*keyBytes long.
134
-		rBytes := r.Bytes()
135
-		rBytesPadded := make([]byte, keyBytes)
136
-		copy(rBytesPadded[keyBytes-len(rBytes):], rBytes)
137
-
138
-		sBytes := s.Bytes()
139
-		sBytesPadded := make([]byte, keyBytes)
140
-		copy(sBytesPadded[keyBytes-len(sBytes):], sBytes)
141
-
142
-		out := append(rBytesPadded, sBytesPadded...)
131
+		// We serialize the outputs (r and s) into big-endian byte arrays
132
+		// padded with zeros on the left to make sure the sizes work out.
133
+		// Output must be 2*keyBytes long.
134
+		out := make([]byte, 2*keyBytes)
135
+		r.FillBytes(out[0:keyBytes]) // r is assigned to the first half of output.
136
+		s.FillBytes(out[keyBytes:])  // s is assigned to the second half of output.
143 137
 
144 138
 		return EncodeSegment(out), nil
145 139
 	} else {

+ 24
- 12
vendor/github.com/golang-jwt/jwt/map_claims.go View File

@@ -34,27 +34,35 @@ func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
34 34
 // Compares the exp claim against cmp.
35 35
 // If required is false, this method will return true if the value matches or is unset
36 36
 func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
37
-	switch exp := m["exp"].(type) {
37
+	exp, ok := m["exp"]
38
+	if !ok {
39
+		return !req
40
+	}
41
+	switch expType := exp.(type) {
38 42
 	case float64:
39
-		return verifyExp(int64(exp), cmp, req)
43
+		return verifyExp(int64(expType), cmp, req)
40 44
 	case json.Number:
41
-		v, _ := exp.Int64()
45
+		v, _ := expType.Int64()
42 46
 		return verifyExp(v, cmp, req)
43 47
 	}
44
-	return !req
48
+	return false
45 49
 }
46 50
 
47 51
 // Compares the iat claim against cmp.
48 52
 // If required is false, this method will return true if the value matches or is unset
49 53
 func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
50
-	switch iat := m["iat"].(type) {
54
+	iat, ok := m["iat"]
55
+	if !ok {
56
+		return !req
57
+	}
58
+	switch iatType := iat.(type) {
51 59
 	case float64:
52
-		return verifyIat(int64(iat), cmp, req)
60
+		return verifyIat(int64(iatType), cmp, req)
53 61
 	case json.Number:
54
-		v, _ := iat.Int64()
62
+		v, _ := iatType.Int64()
55 63
 		return verifyIat(v, cmp, req)
56 64
 	}
57
-	return !req
65
+	return false
58 66
 }
59 67
 
60 68
 // Compares the iss claim against cmp.
@@ -67,14 +75,18 @@ func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
67 75
 // Compares the nbf claim against cmp.
68 76
 // If required is false, this method will return true if the value matches or is unset
69 77
 func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
70
-	switch nbf := m["nbf"].(type) {
78
+	nbf, ok := m["nbf"]
79
+	if !ok {
80
+		return !req
81
+	}
82
+	switch nbfType := nbf.(type) {
71 83
 	case float64:
72
-		return verifyNbf(int64(nbf), cmp, req)
84
+		return verifyNbf(int64(nbfType), cmp, req)
73 85
 	case json.Number:
74
-		v, _ := nbf.Int64()
86
+		v, _ := nbfType.Int64()
75 87
 		return verifyNbf(v, cmp, req)
76 88
 	}
77
-	return !req
89
+	return false
78 90
 }
79 91
 
80 92
 // Validates time based claims "exp, iat, nbf".

+ 2
- 6
vendor/github.com/golang-jwt/jwt/token.go View File

@@ -95,14 +95,10 @@ func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token
95 95
 
96 96
 // Encode JWT specific base64url encoding with padding stripped
97 97
 func EncodeSegment(seg []byte) string {
98
-	return strings.TrimRight(base64.URLEncoding.EncodeToString(seg), "=")
98
+	return base64.RawURLEncoding.EncodeToString(seg)
99 99
 }
100 100
 
101 101
 // Decode JWT specific base64url encoding with padding stripped
102 102
 func DecodeSegment(seg string) ([]byte, error) {
103
-	if l := len(seg) % 4; l > 0 {
104
-		seg += strings.Repeat("=", 4-l)
105
-	}
106
-
107
-	return base64.URLEncoding.DecodeString(seg)
103
+	return base64.RawURLEncoding.DecodeString(seg)
108 104
 }

+ 1
- 0
vendor/golang.org/x/crypto/sha3/keccakf_amd64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build amd64 && !purego && gc
5 6
 // +build amd64,!purego,gc
6 7
 
7 8
 // This code was translated into a form compatible with 6a from the public

+ 1
- 0
vendor/golang.org/x/crypto/sha3/sha3_s390x.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc && !purego
5 6
 // +build gc,!purego
6 7
 
7 8
 #include "textflag.h"

+ 1
- 1
vendor/golang.org/x/crypto/sha3/xor_generic.go View File

@@ -19,7 +19,7 @@ func xorInGeneric(d *state, buf []byte) {
19 19
 	}
20 20
 }
21 21
 
22
-// copyOutGeneric copies ulint64s to a byte buffer.
22
+// copyOutGeneric copies uint64s to a byte buffer.
23 23
 func copyOutGeneric(d *state, b []byte) {
24 24
 	for i := 0; len(b) >= 8; i++ {
25 25
 		binary.LittleEndian.PutUint64(b, d.a[i])

+ 1
- 0
vendor/golang.org/x/sys/cpu/asm_aix_ppc64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 2
- 3
vendor/golang.org/x/sys/cpu/cpu.go View File

@@ -154,14 +154,13 @@ var MIPS64X struct {
154 154
 // For ppc64/ppc64le, it is safe to check only for ISA level starting on ISA v3.00,
155 155
 // since there are no optional categories. There are some exceptions that also
156 156
 // require kernel support to work (DARN, SCV), so there are feature bits for
157
-// those as well. The minimum processor requirement is POWER8 (ISA 2.07).
158
-// The struct is padded to avoid false sharing.
157
+// those as well. The struct is padded to avoid false sharing.
159 158
 var PPC64 struct {
160 159
 	_        CacheLinePad
161 160
 	HasDARN  bool // Hardware random number generator (requires kernel enablement)
162 161
 	HasSCV   bool // Syscall vectored (requires kernel enablement)
163 162
 	IsPOWER8 bool // ISA v2.07 (POWER8)
164
-	IsPOWER9 bool // ISA v3.00 (POWER9)
163
+	IsPOWER9 bool // ISA v3.00 (POWER9), implies IsPOWER8
165 164
 	_        CacheLinePad
166 165
 }
167 166
 

+ 2
- 0
vendor/golang.org/x/sys/cpu/cpu_aix.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build aix
5 6
 // +build aix
6 7
 
7 8
 package cpu
@@ -19,6 +20,7 @@ func archInit() {
19 20
 		PPC64.IsPOWER8 = true
20 21
 	}
21 22
 	if impl&_IMPL_POWER9 != 0 {
23
+		PPC64.IsPOWER8 = true
22 24
 		PPC64.IsPOWER9 = true
23 25
 	}
24 26
 

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_arm64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_gc_arm64.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_gc_s390x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 package cpu

+ 5
- 0
vendor/golang.org/x/sys/cpu/cpu_gc_x86.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (386 || amd64 || amd64p32) && gc
5 6
 // +build 386 amd64 amd64p32
6 7
 // +build gc
7 8
 
@@ -14,3 +15,7 @@ func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
14 15
 // xgetbv with ecx = 0 is implemented in cpu_x86.s for gc compiler
15 16
 // and in cpu_gccgo.c for gccgo.
16 17
 func xgetbv() (eax, edx uint32)
18
+
19
+// darwinSupportsAVX512 is implemented in cpu_x86.s for gc compiler
20
+// and in cpu_gccgo_x86.go for gccgo.
21
+func darwinSupportsAVX512() bool

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gccgo
5 6
 // +build gccgo
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_s390x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gccgo
5 6
 // +build gccgo
6 7
 
7 8
 package cpu

+ 7
- 0
vendor/golang.org/x/sys/cpu/cpu_gccgo_x86.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (386 || amd64 || amd64p32) && gccgo
5 6
 // +build 386 amd64 amd64p32
6 7
 // +build gccgo
7 8
 
@@ -24,3 +25,9 @@ func xgetbv() (eax, edx uint32) {
24 25
 	gccgoXgetbv(&a, &d)
25 26
 	return a, d
26 27
 }
28
+
29
+// gccgo doesn't build on Darwin, per:
30
+// https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/gcc.rb#L76
31
+func darwinSupportsAVX512() bool {
32
+	return false
33
+}

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_linux.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build !386 && !amd64 && !amd64p32 && !arm64
5 6
 // +build !386,!amd64,!amd64p32,!arm64
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_linux_mips64x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && (mips64 || mips64le)
5 6
 // +build linux
6 7
 // +build mips64 mips64le
7 8
 

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
5 6
 // +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_linux_ppc64x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && (ppc64 || ppc64le)
5 6
 // +build linux
6 7
 // +build ppc64 ppc64le
7 8
 

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_mips64x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build mips64 || mips64le
5 6
 // +build mips64 mips64le
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_mipsx.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build mips || mipsle
5 6
 // +build mips mipsle
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_other_arm.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build !linux && arm
5 6
 // +build !linux,arm
6 7
 
7 8
 package cpu

+ 2
- 2
vendor/golang.org/x/sys/cpu/cpu_other_arm64.go View File

@@ -2,8 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build !linux,!netbsd
6
-// +build arm64
5
+//go:build !linux && !netbsd && arm64
6
+// +build !linux,!netbsd,arm64
7 7
 
8 8
 package cpu
9 9
 

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_other_mips64x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build !linux && (mips64 || mips64le)
5 6
 // +build !linux
6 7
 // +build mips64 mips64le
7 8
 

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_ppc64x.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build ppc64 || ppc64le
5 6
 // +build ppc64 ppc64le
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_riscv64.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build riscv64
5 6
 // +build riscv64
6 7
 
7 8
 package cpu

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_s390x.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/cpu/cpu_wasm.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build wasm
5 6
 // +build wasm
6 7
 
7 8
 package cpu

+ 9
- 2
vendor/golang.org/x/sys/cpu/cpu_x86.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build 386 || amd64 || amd64p32
5 6
 // +build 386 amd64 amd64p32
6 7
 
7 8
 package cpu
@@ -86,8 +87,14 @@ func archInit() {
86 87
 		// Check if XMM and YMM registers have OS support.
87 88
 		osSupportsAVX = isSet(1, eax) && isSet(2, eax)
88 89
 
89
-		// Check if OPMASK and ZMM registers have OS support.
90
-		osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
90
+		if runtime.GOOS == "darwin" {
91
+			// Check darwin commpage for AVX512 support. Necessary because:
92
+			// https://github.com/apple/darwin-xnu/blob/0a798f6738bc1db01281fc08ae024145e84df927/osfmk/i386/fpu.c#L175-L201
93
+			osSupportsAVX512 = osSupportsAVX && darwinSupportsAVX512()
94
+		} else {
95
+			// Check if OPMASK and ZMM registers have OS support.
96
+			osSupportsAVX512 = osSupportsAVX && isSet(5, eax) && isSet(6, eax) && isSet(7, eax)
97
+		}
91 98
 	}
92 99
 
93 100
 	X86.HasAVX = isSet(28, ecx1) && osSupportsAVX

+ 25
- 0
vendor/golang.org/x/sys/cpu/cpu_x86.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (386 || amd64 || amd64p32) && gc
5 6
 // +build 386 amd64 amd64p32
6 7
 // +build gc
7 8
 
@@ -25,3 +26,27 @@ TEXT ·xgetbv(SB),NOSPLIT,$0-8
25 26
 	MOVL AX, eax+0(FP)
26 27
 	MOVL DX, edx+4(FP)
27 28
 	RET
29
+
30
+// func darwinSupportsAVX512() bool
31
+TEXT ·darwinSupportsAVX512(SB), NOSPLIT, $0-1
32
+    MOVB    $0, ret+0(FP) // default to false
33
+#ifdef GOOS_darwin   // return if not darwin
34
+#ifdef GOARCH_amd64  // return if not amd64
35
+// These values from:
36
+// https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/osfmk/i386/cpu_capabilities.h
37
+#define commpage64_base_address         0x00007fffffe00000
38
+#define commpage64_cpu_capabilities64   (commpage64_base_address+0x010)
39
+#define commpage64_version              (commpage64_base_address+0x01E)
40
+#define hasAVX512F                      0x0000004000000000
41
+    MOVQ    $commpage64_version, BX
42
+    CMPW    (BX), $13  // cpu_capabilities64 undefined in versions < 13
43
+    JL      no_avx512
44
+    MOVQ    $commpage64_cpu_capabilities64, BX
45
+    MOVQ    $hasAVX512F, CX
46
+    TESTQ   (BX), CX
47
+    JZ      no_avx512
48
+    MOVB    $1, ret+0(FP)
49
+no_avx512:
50
+#endif
51
+#endif
52
+    RET

+ 2
- 2
vendor/golang.org/x/sys/cpu/syscall_aix_gccgo.go View File

@@ -8,8 +8,8 @@
8 8
 // Morever, this file will be used during the building of
9 9
 // gccgo's libgo and thus must not used a CGo method.
10 10
 
11
-// +build aix
12
-// +build gccgo
11
+//go:build aix && gccgo
12
+// +build aix,gccgo
13 13
 
14 14
 package cpu
15 15
 

+ 2
- 2
vendor/golang.org/x/sys/cpu/syscall_aix_ppc64_gc.go View File

@@ -6,8 +6,8 @@
6 6
 // system call on AIX without depending on x/sys/unix.
7 7
 // (See golang.org/issue/32102)
8 8
 
9
-// +build aix,ppc64
10
-// +build gc
9
+//go:build aix && ppc64 && gc
10
+// +build aix,ppc64,gc
11 11
 
12 12
 package cpu
13 13
 

+ 3
- 3
vendor/golang.org/x/sys/unix/README.md View File

@@ -76,7 +76,7 @@ arguments can be passed to the kernel. The third is for low-level use by the
76 76
 ForkExec wrapper. Unlike the first two, it does not call into the scheduler to
77 77
 let it know that a system call is running.
78 78
 
79
-When porting Go to an new architecture/OS, this file must be implemented for
79
+When porting Go to a new architecture/OS, this file must be implemented for
80 80
 each GOOS/GOARCH pair.
81 81
 
82 82
 ### mksysnum
@@ -107,7 +107,7 @@ prototype can be exported (capitalized) or not.
107 107
 Adding a new syscall often just requires adding a new `//sys` function prototype
108 108
 with the desired arguments and a capitalized name so it is exported. However, if
109 109
 you want the interface to the syscall to be different, often one will make an
110
-unexported `//sys` prototype, an then write a custom wrapper in
110
+unexported `//sys` prototype, and then write a custom wrapper in
111 111
 `syscall_${GOOS}.go`.
112 112
 
113 113
 ### types files
@@ -137,7 +137,7 @@ some `#if/#elif` macros in your include statements.
137 137
 
138 138
 This script is used to generate the system's various constants. This doesn't
139 139
 just include the error numbers and error strings, but also the signal numbers
140
-an a wide variety of miscellaneous constants. The constants come from the list
140
+and a wide variety of miscellaneous constants. The constants come from the list
141 141
 of include files in the `includes_${uname}` variable. A regex then picks out
142 142
 the desired `#define` statements, and generates the corresponding Go constants.
143 143
 The error numbers and strings are generated from `#include <errno.h>`, and the

+ 2
- 1
vendor/golang.org/x/sys/unix/aliases.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
5
+//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
6
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
6 7
 // +build go1.9
7 8
 
8 9
 package unix

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_aix_ppc64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

vendor/golang.org/x/sys/unix/asm_openbsd_386.s → vendor/golang.org/x/sys/unix/asm_bsd_386.s View File

@@ -1,14 +1,14 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
1
+// Copyright 2021 The Go Authors. All rights reserved.
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (freebsd || netbsd || openbsd) && gc
6
+// +build freebsd netbsd openbsd
5 7
 // +build gc
6 8
 
7 9
 #include "textflag.h"
8 10
 
9
-//
10
-// System call support for 386, OpenBSD
11
-//
11
+// System call support for 386 BSD
12 12
 
13 13
 // Just jump to package syscall's implementation for all these functions.
14 14
 // The runtime may know about them.
@@ -22,7 +22,7 @@ TEXT	·Syscall6(SB),NOSPLIT,$0-40
22 22
 TEXT	·Syscall9(SB),NOSPLIT,$0-52
23 23
 	JMP	syscall·Syscall9(SB)
24 24
 
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
25
+TEXT	·RawSyscall(SB),NOSPLIT,$0-28
26 26
 	JMP	syscall·RawSyscall(SB)
27 27
 
28 28
 TEXT	·RawSyscall6(SB),NOSPLIT,$0-40

vendor/golang.org/x/sys/unix/asm_darwin_amd64.s → vendor/golang.org/x/sys/unix/asm_bsd_amd64.s View File

@@ -1,14 +1,14 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
1
+// Copyright 2021 The Go Authors. All rights reserved.
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
6
+// +build darwin dragonfly freebsd netbsd openbsd
5 7
 // +build gc
6 8
 
7 9
 #include "textflag.h"
8 10
 
9
-//
10
-// System call support for AMD64, Darwin
11
-//
11
+// System call support for AMD64 BSD
12 12
 
13 13
 // Just jump to package syscall's implementation for all these functions.
14 14
 // The runtime may know about them.

vendor/golang.org/x/sys/unix/asm_darwin_arm.s → vendor/golang.org/x/sys/unix/asm_bsd_arm.s View File

@@ -1,15 +1,14 @@
1
-// Copyright 2015 The Go Authors. All rights reserved.
1
+// Copyright 2021 The Go Authors. All rights reserved.
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (freebsd || netbsd || openbsd) && gc
6
+// +build freebsd netbsd openbsd
5 7
 // +build gc
6
-// +build arm,darwin
7 8
 
8 9
 #include "textflag.h"
9 10
 
10
-//
11
-// System call support for ARM, Darwin
12
-//
11
+// System call support for ARM BSD
13 12
 
14 13
 // Just jump to package syscall's implementation for all these functions.
15 14
 // The runtime may know about them.

vendor/golang.org/x/sys/unix/asm_openbsd_arm64.s → vendor/golang.org/x/sys/unix/asm_bsd_arm64.s View File

@@ -1,14 +1,14 @@
1
-// Copyright 2019 The Go Authors. All rights reserved.
1
+// Copyright 2021 The Go Authors. All rights reserved.
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (darwin || freebsd || netbsd || openbsd) && gc
6
+// +build darwin freebsd netbsd openbsd
5 7
 // +build gc
6 8
 
7 9
 #include "textflag.h"
8 10
 
9
-//
10
-// System call support for arm64, OpenBSD
11
-//
11
+// System call support for ARM64 BSD
12 12
 
13 13
 // Just jump to package syscall's implementation for all these functions.
14 14
 // The runtime may know about them.

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_darwin_386.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for 386, Darwin
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 30
vendor/golang.org/x/sys/unix/asm_darwin_arm64.s View File

@@ -1,30 +0,0 @@
1
-// Copyright 2015 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-// +build arm64,darwin
7
-
8
-#include "textflag.h"
9
-
10
-//
11
-// System call support for AMD64, Darwin
12
-//
13
-
14
-// Just jump to package syscall's implementation for all these functions.
15
-// The runtime may know about them.
16
-
17
-TEXT	·Syscall(SB),NOSPLIT,$0-56
18
-	B	syscall·Syscall(SB)
19
-
20
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
21
-	B	syscall·Syscall6(SB)
22
-
23
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
24
-	B	syscall·Syscall9(SB)
25
-
26
-TEXT	·RawSyscall(SB),NOSPLIT,$0-56
27
-	B	syscall·RawSyscall(SB)
28
-
29
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
30
-	B	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for AMD64, DragonFly
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_freebsd_386.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for 386, FreeBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_freebsd_amd64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for AMD64, FreeBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_freebsd_arm.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2012 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for ARM, FreeBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	B	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	B	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	B	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-28
26
-	B	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	B	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_freebsd_arm64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2018 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for ARM64, FreeBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-56
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	JMP	syscall·RawSyscall6(SB)

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_386.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_amd64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_arm.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_arm64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && arm64 && gc
5 6
 // +build linux
6 7
 // +build arm64
7 8
 // +build gc

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_mips64x.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && (mips64 || mips64le) && gc
5 6
 // +build linux
6 7
 // +build mips64 mips64le
7 8
 // +build gc

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_mipsx.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && (mips || mipsle) && gc
5 6
 // +build linux
6 7
 // +build mips mipsle
7 8
 // +build gc

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build linux && (ppc64 || ppc64le) && gc
5 6
 // +build linux
6 7
 // +build ppc64 ppc64le
7 8
 // +build gc

+ 3
- 1
vendor/golang.org/x/sys/unix/asm_linux_riscv64.s View File

@@ -2,7 +2,9 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build riscv64,gc
5
+//go:build riscv64 && gc
6
+// +build riscv64
7
+// +build gc
6 8
 
7 9
 #include "textflag.h"
8 10
 

+ 2
- 1
vendor/golang.org/x/sys/unix/asm_linux_s390x.s View File

@@ -2,8 +2,9 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build s390x
5
+//go:build linux && s390x && gc
6 6
 // +build linux
7
+// +build s390x
7 8
 // +build gc
8 9
 
9 10
 #include "textflag.h"

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_netbsd_386.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for 386, NetBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT ·RawSyscall(SB),NOSPLIT,$0-28
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_netbsd_amd64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for AMD64, NetBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-56
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_netbsd_arm.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2013 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for ARM, NetBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	B	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	B	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	B	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-28
26
-	B	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	B	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_netbsd_arm64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2019 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for ARM64, NetBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	B	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	B	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	B	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-56
26
-	B	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	B	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_openbsd_amd64.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2009 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for AMD64, OpenBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-56
17
-	JMP	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-80
20
-	JMP	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-104
23
-	JMP	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-56
26
-	JMP	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-80
29
-	JMP	syscall·RawSyscall6(SB)

+ 0
- 29
vendor/golang.org/x/sys/unix/asm_openbsd_arm.s View File

@@ -1,29 +0,0 @@
1
-// Copyright 2017 The Go Authors. All rights reserved.
2
-// Use of this source code is governed by a BSD-style
3
-// license that can be found in the LICENSE file.
4
-
5
-// +build gc
6
-
7
-#include "textflag.h"
8
-
9
-//
10
-// System call support for ARM, OpenBSD
11
-//
12
-
13
-// Just jump to package syscall's implementation for all these functions.
14
-// The runtime may know about them.
15
-
16
-TEXT	·Syscall(SB),NOSPLIT,$0-28
17
-	B	syscall·Syscall(SB)
18
-
19
-TEXT	·Syscall6(SB),NOSPLIT,$0-40
20
-	B	syscall·Syscall6(SB)
21
-
22
-TEXT	·Syscall9(SB),NOSPLIT,$0-52
23
-	B	syscall·Syscall9(SB)
24
-
25
-TEXT	·RawSyscall(SB),NOSPLIT,$0-28
26
-	B	syscall·RawSyscall(SB)
27
-
28
-TEXT	·RawSyscall6(SB),NOSPLIT,$0-40
29
-	B	syscall·RawSyscall6(SB)

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 1
- 0
vendor/golang.org/x/sys/unix/asm_solaris_amd64.s View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gc
5 6
 // +build gc
6 7
 
7 8
 #include "textflag.h"

+ 426
- 0
vendor/golang.org/x/sys/unix/asm_zos_s390x.s View File

@@ -0,0 +1,426 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build zos && s390x && gc
6
+// +build zos
7
+// +build s390x
8
+// +build gc
9
+
10
+#include "textflag.h"
11
+
12
+#define PSALAA            1208(R0)
13
+#define GTAB64(x)           80(x)
14
+#define LCA64(x)            88(x)
15
+#define CAA(x)               8(x)
16
+#define EDCHPXV(x)        1016(x)       // in the CAA
17
+#define SAVSTACK_ASYNC(x)  336(x)       // in the LCA
18
+
19
+// SS_*, where x=SAVSTACK_ASYNC
20
+#define SS_LE(x)             0(x)
21
+#define SS_GO(x)             8(x)
22
+#define SS_ERRNO(x)         16(x)
23
+#define SS_ERRNOJR(x)       20(x)
24
+
25
+#define LE_CALL BYTE $0x0D; BYTE $0x76; // BL R7, R6
26
+
27
+TEXT ·clearErrno(SB),NOSPLIT,$0-0
28
+	BL	addrerrno<>(SB)
29
+	MOVD	$0, 0(R3)
30
+	RET
31
+
32
+// Returns the address of errno in R3.
33
+TEXT addrerrno<>(SB),NOSPLIT|NOFRAME,$0-0
34
+	// Get library control area (LCA).
35
+	MOVW	PSALAA, R8
36
+	MOVD	LCA64(R8), R8
37
+
38
+	// Get __errno FuncDesc.
39
+	MOVD	CAA(R8), R9
40
+	MOVD	EDCHPXV(R9), R9
41
+	ADD	$(0x156*16), R9
42
+	LMG	0(R9), R5, R6
43
+
44
+	// Switch to saved LE stack.
45
+	MOVD	SAVSTACK_ASYNC(R8), R9
46
+	MOVD	0(R9), R4
47
+	MOVD	$0, 0(R9)
48
+
49
+	// Call __errno function.
50
+	LE_CALL
51
+	NOPH
52
+
53
+	// Switch back to Go stack.
54
+	XOR	R0, R0      // Restore R0 to $0.
55
+	MOVD	R4, 0(R9)   // Save stack pointer.
56
+	RET
57
+
58
+TEXT ·syscall_syscall(SB),NOSPLIT,$0-56
59
+	BL	runtime·entersyscall(SB)
60
+	MOVD	a1+8(FP), R1
61
+	MOVD	a2+16(FP), R2
62
+	MOVD	a3+24(FP), R3
63
+
64
+	// Get library control area (LCA).
65
+	MOVW	PSALAA, R8
66
+	MOVD	LCA64(R8), R8
67
+
68
+	// Get function.
69
+	MOVD	CAA(R8), R9
70
+	MOVD	EDCHPXV(R9), R9
71
+	MOVD	trap+0(FP), R5
72
+	SLD	$4, R5
73
+	ADD	R5, R9
74
+	LMG	0(R9), R5, R6
75
+
76
+	// Restore LE stack.
77
+	MOVD	SAVSTACK_ASYNC(R8), R9
78
+	MOVD	0(R9), R4
79
+	MOVD	$0, 0(R9)
80
+
81
+	// Call function.
82
+	LE_CALL
83
+	NOPH
84
+	XOR	R0, R0      // Restore R0 to $0.
85
+	MOVD	R4, 0(R9)   // Save stack pointer.
86
+
87
+	MOVD	R3, r1+32(FP)
88
+	MOVD	R0, r2+40(FP)
89
+	MOVD	R0, err+48(FP)
90
+	MOVW	R3, R4
91
+	CMP	R4, $-1
92
+	BNE	done
93
+	BL	addrerrno<>(SB)
94
+	MOVWZ	0(R3), R3
95
+	MOVD	R3, err+48(FP)
96
+done:
97
+	BL	runtime·exitsyscall(SB)
98
+	RET
99
+
100
+TEXT ·syscall_rawsyscall(SB),NOSPLIT,$0-56
101
+	MOVD	a1+8(FP), R1
102
+	MOVD	a2+16(FP), R2
103
+	MOVD	a3+24(FP), R3
104
+
105
+	// Get library control area (LCA).
106
+	MOVW	PSALAA, R8
107
+	MOVD	LCA64(R8), R8
108
+
109
+	// Get function.
110
+	MOVD	CAA(R8), R9
111
+	MOVD	EDCHPXV(R9), R9
112
+	MOVD	trap+0(FP), R5
113
+	SLD	$4, R5
114
+	ADD	R5, R9
115
+	LMG	0(R9), R5, R6
116
+
117
+	// Restore LE stack.
118
+	MOVD	SAVSTACK_ASYNC(R8), R9
119
+	MOVD	0(R9), R4
120
+	MOVD	$0, 0(R9)
121
+
122
+	// Call function.
123
+	LE_CALL
124
+	NOPH
125
+	XOR	R0, R0      // Restore R0 to $0.
126
+	MOVD	R4, 0(R9)   // Save stack pointer.
127
+
128
+	MOVD	R3, r1+32(FP)
129
+	MOVD	R0, r2+40(FP)
130
+	MOVD	R0, err+48(FP)
131
+	MOVW	R3, R4
132
+	CMP	R4, $-1
133
+	BNE	done
134
+	BL	addrerrno<>(SB)
135
+	MOVWZ	0(R3), R3
136
+	MOVD	R3, err+48(FP)
137
+done:
138
+	RET
139
+
140
+TEXT ·syscall_syscall6(SB),NOSPLIT,$0-80
141
+	BL	runtime·entersyscall(SB)
142
+	MOVD	a1+8(FP), R1
143
+	MOVD	a2+16(FP), R2
144
+	MOVD	a3+24(FP), R3
145
+
146
+	// Get library control area (LCA).
147
+	MOVW	PSALAA, R8
148
+	MOVD	LCA64(R8), R8
149
+
150
+	// Get function.
151
+	MOVD	CAA(R8), R9
152
+	MOVD	EDCHPXV(R9), R9
153
+	MOVD	trap+0(FP), R5
154
+	SLD	$4, R5
155
+	ADD	R5, R9
156
+	LMG	0(R9), R5, R6
157
+
158
+	// Restore LE stack.
159
+	MOVD	SAVSTACK_ASYNC(R8), R9
160
+	MOVD	0(R9), R4
161
+	MOVD	$0, 0(R9)
162
+
163
+	// Fill in parameter list.
164
+	MOVD	a4+32(FP), R12
165
+	MOVD	R12, (2176+24)(R4)
166
+	MOVD	a5+40(FP), R12
167
+	MOVD	R12, (2176+32)(R4)
168
+	MOVD	a6+48(FP), R12
169
+	MOVD	R12, (2176+40)(R4)
170
+
171
+	// Call function.
172
+	LE_CALL
173
+	NOPH
174
+	XOR	R0, R0      // Restore R0 to $0.
175
+	MOVD	R4, 0(R9)   // Save stack pointer.
176
+
177
+	MOVD	R3, r1+56(FP)
178
+	MOVD	R0, r2+64(FP)
179
+	MOVD	R0, err+72(FP)
180
+	MOVW	R3, R4
181
+	CMP	R4, $-1
182
+	BNE	done
183
+	BL	addrerrno<>(SB)
184
+	MOVWZ	0(R3), R3
185
+	MOVD	R3, err+72(FP)
186
+done:
187
+	BL	runtime·exitsyscall(SB)
188
+	RET
189
+
190
+TEXT ·syscall_rawsyscall6(SB),NOSPLIT,$0-80
191
+	MOVD	a1+8(FP), R1
192
+	MOVD	a2+16(FP), R2
193
+	MOVD	a3+24(FP), R3
194
+
195
+	// Get library control area (LCA).
196
+	MOVW	PSALAA, R8
197
+	MOVD	LCA64(R8), R8
198
+
199
+	// Get function.
200
+	MOVD	CAA(R8), R9
201
+	MOVD	EDCHPXV(R9), R9
202
+	MOVD	trap+0(FP), R5
203
+	SLD	$4, R5
204
+	ADD	R5, R9
205
+	LMG	0(R9), R5, R6
206
+
207
+	// Restore LE stack.
208
+	MOVD	SAVSTACK_ASYNC(R8), R9
209
+	MOVD	0(R9), R4
210
+	MOVD	$0, 0(R9)
211
+
212
+	// Fill in parameter list.
213
+	MOVD	a4+32(FP), R12
214
+	MOVD	R12, (2176+24)(R4)
215
+	MOVD	a5+40(FP), R12
216
+	MOVD	R12, (2176+32)(R4)
217
+	MOVD	a6+48(FP), R12
218
+	MOVD	R12, (2176+40)(R4)
219
+
220
+	// Call function.
221
+	LE_CALL
222
+	NOPH
223
+	XOR	R0, R0      // Restore R0 to $0.
224
+	MOVD	R4, 0(R9)   // Save stack pointer.
225
+
226
+	MOVD	R3, r1+56(FP)
227
+	MOVD	R0, r2+64(FP)
228
+	MOVD	R0, err+72(FP)
229
+	MOVW	R3, R4
230
+	CMP	R4, $-1
231
+	BNE	done
232
+	BL	·rrno<>(SB)
233
+	MOVWZ	0(R3), R3
234
+	MOVD	R3, err+72(FP)
235
+done:
236
+	RET
237
+
238
+TEXT ·syscall_syscall9(SB),NOSPLIT,$0
239
+	BL	runtime·entersyscall(SB)
240
+	MOVD	a1+8(FP), R1
241
+	MOVD	a2+16(FP), R2
242
+	MOVD	a3+24(FP), R3
243
+
244
+	// Get library control area (LCA).
245
+	MOVW	PSALAA, R8
246
+	MOVD	LCA64(R8), R8
247
+
248
+	// Get function.
249
+	MOVD	CAA(R8), R9
250
+	MOVD	EDCHPXV(R9), R9
251
+	MOVD	trap+0(FP), R5
252
+	SLD	$4, R5
253
+	ADD	R5, R9
254
+	LMG	0(R9), R5, R6
255
+
256
+	// Restore LE stack.
257
+	MOVD	SAVSTACK_ASYNC(R8), R9
258
+	MOVD	0(R9), R4
259
+	MOVD	$0, 0(R9)
260
+
261
+	// Fill in parameter list.
262
+	MOVD	a4+32(FP), R12
263
+	MOVD	R12, (2176+24)(R4)
264
+	MOVD	a5+40(FP), R12
265
+	MOVD	R12, (2176+32)(R4)
266
+	MOVD	a6+48(FP), R12
267
+	MOVD	R12, (2176+40)(R4)
268
+	MOVD	a7+56(FP), R12
269
+	MOVD	R12, (2176+48)(R4)
270
+	MOVD	a8+64(FP), R12
271
+	MOVD	R12, (2176+56)(R4)
272
+	MOVD	a9+72(FP), R12
273
+	MOVD	R12, (2176+64)(R4)
274
+
275
+	// Call function.
276
+	LE_CALL
277
+	NOPH
278
+	XOR	R0, R0      // Restore R0 to $0.
279
+	MOVD	R4, 0(R9)   // Save stack pointer.
280
+
281
+	MOVD	R3, r1+80(FP)
282
+	MOVD	R0, r2+88(FP)
283
+	MOVD	R0, err+96(FP)
284
+	MOVW	R3, R4
285
+	CMP	R4, $-1
286
+	BNE	done
287
+	BL	addrerrno<>(SB)
288
+	MOVWZ	0(R3), R3
289
+	MOVD	R3, err+96(FP)
290
+done:
291
+        BL	runtime·exitsyscall(SB)
292
+        RET
293
+
294
+TEXT ·syscall_rawsyscall9(SB),NOSPLIT,$0
295
+	MOVD	a1+8(FP), R1
296
+	MOVD	a2+16(FP), R2
297
+	MOVD	a3+24(FP), R3
298
+
299
+	// Get library control area (LCA).
300
+	MOVW	PSALAA, R8
301
+	MOVD	LCA64(R8), R8
302
+
303
+	// Get function.
304
+	MOVD	CAA(R8), R9
305
+	MOVD	EDCHPXV(R9), R9
306
+	MOVD	trap+0(FP), R5
307
+	SLD	$4, R5
308
+	ADD	R5, R9
309
+	LMG	0(R9), R5, R6
310
+
311
+	// Restore LE stack.
312
+	MOVD	SAVSTACK_ASYNC(R8), R9
313
+	MOVD	0(R9), R4
314
+	MOVD	$0, 0(R9)
315
+
316
+	// Fill in parameter list.
317
+	MOVD	a4+32(FP), R12
318
+	MOVD	R12, (2176+24)(R4)
319
+	MOVD	a5+40(FP), R12
320
+	MOVD	R12, (2176+32)(R4)
321
+	MOVD	a6+48(FP), R12
322
+	MOVD	R12, (2176+40)(R4)
323
+	MOVD	a7+56(FP), R12
324
+	MOVD	R12, (2176+48)(R4)
325
+	MOVD	a8+64(FP), R12
326
+	MOVD	R12, (2176+56)(R4)
327
+	MOVD	a9+72(FP), R12
328
+	MOVD	R12, (2176+64)(R4)
329
+
330
+	// Call function.
331
+	LE_CALL
332
+	NOPH
333
+	XOR	R0, R0      // Restore R0 to $0.
334
+	MOVD	R4, 0(R9)   // Save stack pointer.
335
+
336
+	MOVD	R3, r1+80(FP)
337
+	MOVD	R0, r2+88(FP)
338
+	MOVD	R0, err+96(FP)
339
+	MOVW	R3, R4
340
+	CMP	R4, $-1
341
+	BNE	done
342
+	BL	addrerrno<>(SB)
343
+	MOVWZ	0(R3), R3
344
+	MOVD	R3, err+96(FP)
345
+done:
346
+	RET
347
+
348
+// func svcCall(fnptr unsafe.Pointer, argv *unsafe.Pointer, dsa *uint64)
349
+TEXT ·svcCall(SB),NOSPLIT,$0
350
+	BL	runtime·save_g(SB)   // Save g and stack pointer
351
+	MOVW	PSALAA, R8
352
+	MOVD	LCA64(R8), R8
353
+	MOVD	SAVSTACK_ASYNC(R8), R9
354
+	MOVD	R15, 0(R9)
355
+
356
+	MOVD	argv+8(FP), R1       // Move function arguments into registers
357
+	MOVD	dsa+16(FP), g
358
+	MOVD	fnptr+0(FP), R15
359
+
360
+	BYTE	$0x0D                // Branch to function
361
+	BYTE	$0xEF
362
+
363
+	BL	runtime·load_g(SB)   // Restore g and stack pointer
364
+	MOVW	PSALAA, R8
365
+	MOVD	LCA64(R8), R8
366
+	MOVD	SAVSTACK_ASYNC(R8), R9
367
+	MOVD	0(R9), R15
368
+
369
+	RET
370
+
371
+// func svcLoad(name *byte) unsafe.Pointer
372
+TEXT ·svcLoad(SB),NOSPLIT,$0
373
+	MOVD	R15, R2          // Save go stack pointer
374
+	MOVD	name+0(FP), R0   // Move SVC args into registers
375
+	MOVD	$0x80000000, R1
376
+	MOVD	$0, R15
377
+	BYTE	$0x0A            // SVC 08 LOAD
378
+	BYTE	$0x08
379
+	MOVW	R15, R3          // Save return code from SVC
380
+	MOVD	R2, R15          // Restore go stack pointer
381
+	CMP	R3, $0           // Check SVC return code
382
+	BNE	error
383
+
384
+	MOVD	$-2, R3          // Reset last bit of entry point to zero
385
+	AND	R0, R3
386
+	MOVD	R3, addr+8(FP)   // Return entry point returned by SVC
387
+	CMP	R0, R3           // Check if last bit of entry point was set
388
+	BNE	done
389
+
390
+	MOVD	R15, R2          // Save go stack pointer
391
+	MOVD	$0, R15          // Move SVC args into registers (entry point still in r0 from SVC 08)
392
+	BYTE	$0x0A            // SVC 09 DELETE
393
+	BYTE	$0x09
394
+	MOVD	R2, R15          // Restore go stack pointer
395
+
396
+error:
397
+	MOVD	$0, addr+8(FP)   // Return 0 on failure
398
+done:
399
+	XOR	R0, R0           // Reset r0 to 0
400
+	RET
401
+
402
+// func svcUnload(name *byte, fnptr unsafe.Pointer) int64
403
+TEXT ·svcUnload(SB),NOSPLIT,$0
404
+	MOVD	R15, R2          // Save go stack pointer
405
+	MOVD	name+0(FP), R0   // Move SVC args into registers
406
+	MOVD	addr+8(FP), R15
407
+	BYTE	$0x0A            // SVC 09
408
+	BYTE	$0x09
409
+	XOR	R0, R0           // Reset r0 to 0
410
+	MOVD	R15, R1          // Save SVC return code
411
+	MOVD	R2, R15          // Restore go stack pointer
412
+	MOVD	R1, rc+0(FP)     // Return SVC return code
413
+	RET
414
+
415
+// func gettid() uint64
416
+TEXT ·gettid(SB), NOSPLIT, $0
417
+	// Get library control area (LCA).
418
+	MOVW PSALAA, R8
419
+	MOVD LCA64(R8), R8
420
+
421
+	// Get CEECAATHDID
422
+	MOVD CAA(R8), R9
423
+	MOVD 0x3D0(R9), R9
424
+	MOVD R9, ret+0(FP)
425
+
426
+	RET

+ 1
- 0
vendor/golang.org/x/sys/unix/cap_freebsd.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build freebsd
5 6
 // +build freebsd
6 7
 
7 8
 package unix

+ 2
- 1
vendor/golang.org/x/sys/unix/constants.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
6 7
 
7 8
 package unix
8 9
 

+ 2
- 2
vendor/golang.org/x/sys/unix/dev_aix_ppc.go View File

@@ -2,8 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix
6
-// +build ppc
5
+//go:build aix && ppc
6
+// +build aix,ppc
7 7
 
8 8
 // Functions to access/create device major and minor numbers matching the
9 9
 // encoding used by AIX.

+ 2
- 2
vendor/golang.org/x/sys/unix/dev_aix_ppc64.go View File

@@ -2,8 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix
6
-// +build ppc64
5
+//go:build aix && ppc64
6
+// +build aix,ppc64
7 7
 
8 8
 // Functions to access/create device major and minor numbers matching the
9 9
 // encoding used AIX.

+ 29
- 0
vendor/golang.org/x/sys/unix/dev_zos.go View File

@@ -0,0 +1,29 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build zos && s390x
6
+// +build zos,s390x
7
+
8
+// Functions to access/create device major and minor numbers matching the
9
+// encoding used by z/OS.
10
+//
11
+// The information below is extracted and adapted from <sys/stat.h> macros.
12
+
13
+package unix
14
+
15
+// Major returns the major component of a z/OS device number.
16
+func Major(dev uint64) uint32 {
17
+	return uint32((dev >> 16) & 0x0000FFFF)
18
+}
19
+
20
+// Minor returns the minor component of a z/OS device number.
21
+func Minor(dev uint64) uint32 {
22
+	return uint32(dev & 0x0000FFFF)
23
+}
24
+
25
+// Mkdev returns a z/OS device number generated from the given major and minor
26
+// components.
27
+func Mkdev(major, minor uint32) uint64 {
28
+	return (uint64(major) << 16) | uint64(minor)
29
+}

+ 1
- 0
vendor/golang.org/x/sys/unix/dirent.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
5 6
 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 7
 
7 8
 package unix

+ 1
- 0
vendor/golang.org/x/sys/unix/endian_big.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 //
5
+//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
5 6
 // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
6 7
 
7 8
 package unix

+ 1
- 0
vendor/golang.org/x/sys/unix/endian_little.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 //
5
+//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
5 6
 // +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
6 7
 
7 8
 package unix

+ 2
- 1
vendor/golang.org/x/sys/unix/env_unix.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
6 7
 
7 8
 // Unix environment variables.
8 9
 

+ 221
- 0
vendor/golang.org/x/sys/unix/epoll_zos.go View File

@@ -0,0 +1,221 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build zos && s390x
6
+// +build zos,s390x
7
+
8
+package unix
9
+
10
+import (
11
+	"sync"
12
+)
13
+
14
+// This file simulates epoll on z/OS using poll.
15
+
16
+// Analogous to epoll_event on Linux.
17
+// TODO(neeilan): Pad is because the Linux kernel expects a 96-bit struct. We never pass this to the kernel; remove?
18
+type EpollEvent struct {
19
+	Events uint32
20
+	Fd     int32
21
+	Pad    int32
22
+}
23
+
24
+const (
25
+	EPOLLERR      = 0x8
26
+	EPOLLHUP      = 0x10
27
+	EPOLLIN       = 0x1
28
+	EPOLLMSG      = 0x400
29
+	EPOLLOUT      = 0x4
30
+	EPOLLPRI      = 0x2
31
+	EPOLLRDBAND   = 0x80
32
+	EPOLLRDNORM   = 0x40
33
+	EPOLLWRBAND   = 0x200
34
+	EPOLLWRNORM   = 0x100
35
+	EPOLL_CTL_ADD = 0x1
36
+	EPOLL_CTL_DEL = 0x2
37
+	EPOLL_CTL_MOD = 0x3
38
+	// The following constants are part of the epoll API, but represent
39
+	// currently unsupported functionality on z/OS.
40
+	// EPOLL_CLOEXEC  = 0x80000
41
+	// EPOLLET        = 0x80000000
42
+	// EPOLLONESHOT   = 0x40000000
43
+	// EPOLLRDHUP     = 0x2000     // Typically used with edge-triggered notis
44
+	// EPOLLEXCLUSIVE = 0x10000000 // Exclusive wake-up mode
45
+	// EPOLLWAKEUP    = 0x20000000 // Relies on Linux's BLOCK_SUSPEND capability
46
+)
47
+
48
+// TODO(neeilan): We can eliminate these epToPoll / pToEpoll calls by using identical mask values for POLL/EPOLL
49
+// constants where possible The lower 16 bits of epoll events (uint32) can fit any system poll event (int16).
50
+
51
+// epToPollEvt converts epoll event field to poll equivalent.
52
+// In epoll, Events is a 32-bit field, while poll uses 16 bits.
53
+func epToPollEvt(events uint32) int16 {
54
+	var ep2p = map[uint32]int16{
55
+		EPOLLIN:  POLLIN,
56
+		EPOLLOUT: POLLOUT,
57
+		EPOLLHUP: POLLHUP,
58
+		EPOLLPRI: POLLPRI,
59
+		EPOLLERR: POLLERR,
60
+	}
61
+
62
+	var pollEvts int16 = 0
63
+	for epEvt, pEvt := range ep2p {
64
+		if (events & epEvt) != 0 {
65
+			pollEvts |= pEvt
66
+		}
67
+	}
68
+
69
+	return pollEvts
70
+}
71
+
72
+// pToEpollEvt converts 16 bit poll event bitfields to 32-bit epoll event fields.
73
+func pToEpollEvt(revents int16) uint32 {
74
+	var p2ep = map[int16]uint32{
75
+		POLLIN:  EPOLLIN,
76
+		POLLOUT: EPOLLOUT,
77
+		POLLHUP: EPOLLHUP,
78
+		POLLPRI: EPOLLPRI,
79
+		POLLERR: EPOLLERR,
80
+	}
81
+
82
+	var epollEvts uint32 = 0
83
+	for pEvt, epEvt := range p2ep {
84
+		if (revents & pEvt) != 0 {
85
+			epollEvts |= epEvt
86
+		}
87
+	}
88
+
89
+	return epollEvts
90
+}
91
+
92
+// Per-process epoll implementation.
93
+type epollImpl struct {
94
+	mu       sync.Mutex
95
+	epfd2ep  map[int]*eventPoll
96
+	nextEpfd int
97
+}
98
+
99
+// eventPoll holds a set of file descriptors being watched by the process. A process can have multiple epoll instances.
100
+// On Linux, this is an in-kernel data structure accessed through a fd.
101
+type eventPoll struct {
102
+	mu  sync.Mutex
103
+	fds map[int]*EpollEvent
104
+}
105
+
106
+// epoll impl for this process.
107
+var impl epollImpl = epollImpl{
108
+	epfd2ep:  make(map[int]*eventPoll),
109
+	nextEpfd: 0,
110
+}
111
+
112
+func (e *epollImpl) epollcreate(size int) (epfd int, err error) {
113
+	e.mu.Lock()
114
+	defer e.mu.Unlock()
115
+	epfd = e.nextEpfd
116
+	e.nextEpfd++
117
+
118
+	e.epfd2ep[epfd] = &eventPoll{
119
+		fds: make(map[int]*EpollEvent),
120
+	}
121
+	return epfd, nil
122
+}
123
+
124
+func (e *epollImpl) epollcreate1(flag int) (fd int, err error) {
125
+	return e.epollcreate(4)
126
+}
127
+
128
+func (e *epollImpl) epollctl(epfd int, op int, fd int, event *EpollEvent) (err error) {
129
+	e.mu.Lock()
130
+	defer e.mu.Unlock()
131
+
132
+	ep, ok := e.epfd2ep[epfd]
133
+	if !ok {
134
+
135
+		return EBADF
136
+	}
137
+
138
+	switch op {
139
+	case EPOLL_CTL_ADD:
140
+		// TODO(neeilan): When we make epfds and fds disjoint, detect epoll
141
+		// loops here (instances watching each other) and return ELOOP.
142
+		if _, ok := ep.fds[fd]; ok {
143
+			return EEXIST
144
+		}
145
+		ep.fds[fd] = event
146
+	case EPOLL_CTL_MOD:
147
+		if _, ok := ep.fds[fd]; !ok {
148
+			return ENOENT
149
+		}
150
+		ep.fds[fd] = event
151
+	case EPOLL_CTL_DEL:
152
+		if _, ok := ep.fds[fd]; !ok {
153
+			return ENOENT
154
+		}
155
+		delete(ep.fds, fd)
156
+
157
+	}
158
+	return nil
159
+}
160
+
161
+// Must be called while holding ep.mu
162
+func (ep *eventPoll) getFds() []int {
163
+	fds := make([]int, len(ep.fds))
164
+	for fd := range ep.fds {
165
+		fds = append(fds, fd)
166
+	}
167
+	return fds
168
+}
169
+
170
+func (e *epollImpl) epollwait(epfd int, events []EpollEvent, msec int) (n int, err error) {
171
+	e.mu.Lock() // in [rare] case of concurrent epollcreate + epollwait
172
+	ep, ok := e.epfd2ep[epfd]
173
+
174
+	if !ok {
175
+		e.mu.Unlock()
176
+		return 0, EBADF
177
+	}
178
+
179
+	pollfds := make([]PollFd, 4)
180
+	for fd, epollevt := range ep.fds {
181
+		pollfds = append(pollfds, PollFd{Fd: int32(fd), Events: epToPollEvt(epollevt.Events)})
182
+	}
183
+	e.mu.Unlock()
184
+
185
+	n, err = Poll(pollfds, msec)
186
+	if err != nil {
187
+		return n, err
188
+	}
189
+
190
+	i := 0
191
+	for _, pFd := range pollfds {
192
+		if pFd.Revents != 0 {
193
+			events[i] = EpollEvent{Fd: pFd.Fd, Events: pToEpollEvt(pFd.Revents)}
194
+			i++
195
+		}
196
+
197
+		if i == n {
198
+			break
199
+		}
200
+	}
201
+
202
+	return n, nil
203
+}
204
+
205
+func EpollCreate(size int) (fd int, err error) {
206
+	return impl.epollcreate(size)
207
+}
208
+
209
+func EpollCreate1(flag int) (fd int, err error) {
210
+	return impl.epollcreate1(flag)
211
+}
212
+
213
+func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) {
214
+	return impl.epollctl(epfd, op, fd, event)
215
+}
216
+
217
+// Because EpollWait mutates events, the caller is expected to coordinate
218
+// concurrent access if calling with the same epfd from multiple goroutines.
219
+func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) {
220
+	return impl.epollwait(epfd, events, msec)
221
+}

+ 1
- 0
vendor/golang.org/x/sys/unix/fcntl.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build dragonfly || freebsd || linux || netbsd || openbsd
5 6
 // +build dragonfly freebsd linux netbsd openbsd
6 7
 
7 8
 package unix

+ 2
- 1
vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build linux,386 linux,arm linux,mips linux,mipsle
5
+//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
6
+// +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc
6 7
 
7 8
 package unix
8 9
 

+ 2
- 1
vendor/golang.org/x/sys/unix/fdset.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
6 7
 
7 8
 package unix
8 9
 

+ 164
- 0
vendor/golang.org/x/sys/unix/fstatfs_zos.go View File

@@ -0,0 +1,164 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build zos && s390x
6
+// +build zos,s390x
7
+
8
+package unix
9
+
10
+import (
11
+	"unsafe"
12
+)
13
+
14
+// This file simulates fstatfs on z/OS using fstatvfs and w_getmntent.
15
+
16
+func Fstatfs(fd int, stat *Statfs_t) (err error) {
17
+	var stat_v Statvfs_t
18
+	err = Fstatvfs(fd, &stat_v)
19
+	if err == nil {
20
+		// populate stat
21
+		stat.Type = 0
22
+		stat.Bsize = stat_v.Bsize
23
+		stat.Blocks = stat_v.Blocks
24
+		stat.Bfree = stat_v.Bfree
25
+		stat.Bavail = stat_v.Bavail
26
+		stat.Files = stat_v.Files
27
+		stat.Ffree = stat_v.Ffree
28
+		stat.Fsid = stat_v.Fsid
29
+		stat.Namelen = stat_v.Namemax
30
+		stat.Frsize = stat_v.Frsize
31
+		stat.Flags = stat_v.Flag
32
+		for passn := 0; passn < 5; passn++ {
33
+			switch passn {
34
+			case 0:
35
+				err = tryGetmntent64(stat)
36
+				break
37
+			case 1:
38
+				err = tryGetmntent128(stat)
39
+				break
40
+			case 2:
41
+				err = tryGetmntent256(stat)
42
+				break
43
+			case 3:
44
+				err = tryGetmntent512(stat)
45
+				break
46
+			case 4:
47
+				err = tryGetmntent1024(stat)
48
+				break
49
+			default:
50
+				break
51
+			}
52
+			//proceed to return if: err is nil (found), err is nonnil but not ERANGE (another error occurred)
53
+			if err == nil || err != nil && err != ERANGE {
54
+				break
55
+			}
56
+		}
57
+	}
58
+	return err
59
+}
60
+
61
+func tryGetmntent64(stat *Statfs_t) (err error) {
62
+	var mnt_ent_buffer struct {
63
+		header       W_Mnth
64
+		filesys_info [64]W_Mntent
65
+	}
66
+	var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
67
+	fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
68
+	if err != nil {
69
+		return err
70
+	}
71
+	err = ERANGE //return ERANGE if no match is found in this batch
72
+	for i := 0; i < fs_count; i++ {
73
+		if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
74
+			stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
75
+			err = nil
76
+			break
77
+		}
78
+	}
79
+	return err
80
+}
81
+
82
+func tryGetmntent128(stat *Statfs_t) (err error) {
83
+	var mnt_ent_buffer struct {
84
+		header       W_Mnth
85
+		filesys_info [128]W_Mntent
86
+	}
87
+	var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
88
+	fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
89
+	if err != nil {
90
+		return err
91
+	}
92
+	err = ERANGE //return ERANGE if no match is found in this batch
93
+	for i := 0; i < fs_count; i++ {
94
+		if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
95
+			stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
96
+			err = nil
97
+			break
98
+		}
99
+	}
100
+	return err
101
+}
102
+
103
+func tryGetmntent256(stat *Statfs_t) (err error) {
104
+	var mnt_ent_buffer struct {
105
+		header       W_Mnth
106
+		filesys_info [256]W_Mntent
107
+	}
108
+	var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
109
+	fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
110
+	if err != nil {
111
+		return err
112
+	}
113
+	err = ERANGE //return ERANGE if no match is found in this batch
114
+	for i := 0; i < fs_count; i++ {
115
+		if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
116
+			stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
117
+			err = nil
118
+			break
119
+		}
120
+	}
121
+	return err
122
+}
123
+
124
+func tryGetmntent512(stat *Statfs_t) (err error) {
125
+	var mnt_ent_buffer struct {
126
+		header       W_Mnth
127
+		filesys_info [512]W_Mntent
128
+	}
129
+	var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
130
+	fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
131
+	if err != nil {
132
+		return err
133
+	}
134
+	err = ERANGE //return ERANGE if no match is found in this batch
135
+	for i := 0; i < fs_count; i++ {
136
+		if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
137
+			stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
138
+			err = nil
139
+			break
140
+		}
141
+	}
142
+	return err
143
+}
144
+
145
+func tryGetmntent1024(stat *Statfs_t) (err error) {
146
+	var mnt_ent_buffer struct {
147
+		header       W_Mnth
148
+		filesys_info [1024]W_Mntent
149
+	}
150
+	var buffer_size int = int(unsafe.Sizeof(mnt_ent_buffer))
151
+	fs_count, err := W_Getmntent((*byte)(unsafe.Pointer(&mnt_ent_buffer)), buffer_size)
152
+	if err != nil {
153
+		return err
154
+	}
155
+	err = ERANGE //return ERANGE if no match is found in this batch
156
+	for i := 0; i < fs_count; i++ {
157
+		if stat.Fsid == uint64(mnt_ent_buffer.filesys_info[i].Dev) {
158
+			stat.Type = uint32(mnt_ent_buffer.filesys_info[i].Fstname[0])
159
+			err = nil
160
+			break
161
+		}
162
+	}
163
+	return err
164
+}

+ 2
- 2
vendor/golang.org/x/sys/unix/gccgo.go View File

@@ -2,8 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build gccgo
6
-// +build !aix
5
+//go:build gccgo && !aix
6
+// +build gccgo,!aix
7 7
 
8 8
 package unix
9 9
 

+ 1
- 0
vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build gccgo && linux && amd64
5 6
 // +build gccgo,linux,amd64
6 7
 
7 8
 package unix

+ 1
- 0
vendor/golang.org/x/sys/unix/ioctl.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
5 6
 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 7
 
7 8
 package unix

+ 196
- 0
vendor/golang.org/x/sys/unix/ioctl_linux.go View File

@@ -0,0 +1,196 @@
1
+// Copyright 2021 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+package unix
6
+
7
+import (
8
+	"runtime"
9
+	"unsafe"
10
+)
11
+
12
+// IoctlRetInt performs an ioctl operation specified by req on a device
13
+// associated with opened file descriptor fd, and returns a non-negative
14
+// integer that is returned by the ioctl syscall.
15
+func IoctlRetInt(fd int, req uint) (int, error) {
16
+	ret, _, err := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), 0)
17
+	if err != 0 {
18
+		return 0, err
19
+	}
20
+	return int(ret), nil
21
+}
22
+
23
+func IoctlGetUint32(fd int, req uint) (uint32, error) {
24
+	var value uint32
25
+	err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
26
+	return value, err
27
+}
28
+
29
+func IoctlGetRTCTime(fd int) (*RTCTime, error) {
30
+	var value RTCTime
31
+	err := ioctl(fd, RTC_RD_TIME, uintptr(unsafe.Pointer(&value)))
32
+	return &value, err
33
+}
34
+
35
+func IoctlSetRTCTime(fd int, value *RTCTime) error {
36
+	err := ioctl(fd, RTC_SET_TIME, uintptr(unsafe.Pointer(value)))
37
+	runtime.KeepAlive(value)
38
+	return err
39
+}
40
+
41
+func IoctlGetRTCWkAlrm(fd int) (*RTCWkAlrm, error) {
42
+	var value RTCWkAlrm
43
+	err := ioctl(fd, RTC_WKALM_RD, uintptr(unsafe.Pointer(&value)))
44
+	return &value, err
45
+}
46
+
47
+func IoctlSetRTCWkAlrm(fd int, value *RTCWkAlrm) error {
48
+	err := ioctl(fd, RTC_WKALM_SET, uintptr(unsafe.Pointer(value)))
49
+	runtime.KeepAlive(value)
50
+	return err
51
+}
52
+
53
+type ifreqEthtool struct {
54
+	name [IFNAMSIZ]byte
55
+	data unsafe.Pointer
56
+}
57
+
58
+// IoctlGetEthtoolDrvinfo fetches ethtool driver information for the network
59
+// device specified by ifname.
60
+func IoctlGetEthtoolDrvinfo(fd int, ifname string) (*EthtoolDrvinfo, error) {
61
+	// Leave room for terminating NULL byte.
62
+	if len(ifname) >= IFNAMSIZ {
63
+		return nil, EINVAL
64
+	}
65
+
66
+	value := EthtoolDrvinfo{
67
+		Cmd: ETHTOOL_GDRVINFO,
68
+	}
69
+	ifreq := ifreqEthtool{
70
+		data: unsafe.Pointer(&value),
71
+	}
72
+	copy(ifreq.name[:], ifname)
73
+	err := ioctl(fd, SIOCETHTOOL, uintptr(unsafe.Pointer(&ifreq)))
74
+	runtime.KeepAlive(ifreq)
75
+	return &value, err
76
+}
77
+
78
+// IoctlGetWatchdogInfo fetches information about a watchdog device from the
79
+// Linux watchdog API. For more information, see:
80
+// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html.
81
+func IoctlGetWatchdogInfo(fd int) (*WatchdogInfo, error) {
82
+	var value WatchdogInfo
83
+	err := ioctl(fd, WDIOC_GETSUPPORT, uintptr(unsafe.Pointer(&value)))
84
+	return &value, err
85
+}
86
+
87
+// IoctlWatchdogKeepalive issues a keepalive ioctl to a watchdog device. For
88
+// more information, see:
89
+// https://www.kernel.org/doc/html/latest/watchdog/watchdog-api.html.
90
+func IoctlWatchdogKeepalive(fd int) error {
91
+	return ioctl(fd, WDIOC_KEEPALIVE, 0)
92
+}
93
+
94
+// IoctlFileCloneRange performs an FICLONERANGE ioctl operation to clone the
95
+// range of data conveyed in value to the file associated with the file
96
+// descriptor destFd. See the ioctl_ficlonerange(2) man page for details.
97
+func IoctlFileCloneRange(destFd int, value *FileCloneRange) error {
98
+	err := ioctl(destFd, FICLONERANGE, uintptr(unsafe.Pointer(value)))
99
+	runtime.KeepAlive(value)
100
+	return err
101
+}
102
+
103
+// IoctlFileClone performs an FICLONE ioctl operation to clone the entire file
104
+// associated with the file description srcFd to the file associated with the
105
+// file descriptor destFd. See the ioctl_ficlone(2) man page for details.
106
+func IoctlFileClone(destFd, srcFd int) error {
107
+	return ioctl(destFd, FICLONE, uintptr(srcFd))
108
+}
109
+
110
+type FileDedupeRange struct {
111
+	Src_offset uint64
112
+	Src_length uint64
113
+	Reserved1  uint16
114
+	Reserved2  uint32
115
+	Info       []FileDedupeRangeInfo
116
+}
117
+
118
+type FileDedupeRangeInfo struct {
119
+	Dest_fd       int64
120
+	Dest_offset   uint64
121
+	Bytes_deduped uint64
122
+	Status        int32
123
+	Reserved      uint32
124
+}
125
+
126
+// IoctlFileDedupeRange performs an FIDEDUPERANGE ioctl operation to share the
127
+// range of data conveyed in value from the file associated with the file
128
+// descriptor srcFd to the value.Info destinations. See the
129
+// ioctl_fideduperange(2) man page for details.
130
+func IoctlFileDedupeRange(srcFd int, value *FileDedupeRange) error {
131
+	buf := make([]byte, SizeofRawFileDedupeRange+
132
+		len(value.Info)*SizeofRawFileDedupeRangeInfo)
133
+	rawrange := (*RawFileDedupeRange)(unsafe.Pointer(&buf[0]))
134
+	rawrange.Src_offset = value.Src_offset
135
+	rawrange.Src_length = value.Src_length
136
+	rawrange.Dest_count = uint16(len(value.Info))
137
+	rawrange.Reserved1 = value.Reserved1
138
+	rawrange.Reserved2 = value.Reserved2
139
+
140
+	for i := range value.Info {
141
+		rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer(
142
+			uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) +
143
+				uintptr(i*SizeofRawFileDedupeRangeInfo)))
144
+		rawinfo.Dest_fd = value.Info[i].Dest_fd
145
+		rawinfo.Dest_offset = value.Info[i].Dest_offset
146
+		rawinfo.Bytes_deduped = value.Info[i].Bytes_deduped
147
+		rawinfo.Status = value.Info[i].Status
148
+		rawinfo.Reserved = value.Info[i].Reserved
149
+	}
150
+
151
+	err := ioctl(srcFd, FIDEDUPERANGE, uintptr(unsafe.Pointer(&buf[0])))
152
+
153
+	// Output
154
+	for i := range value.Info {
155
+		rawinfo := (*RawFileDedupeRangeInfo)(unsafe.Pointer(
156
+			uintptr(unsafe.Pointer(&buf[0])) + uintptr(SizeofRawFileDedupeRange) +
157
+				uintptr(i*SizeofRawFileDedupeRangeInfo)))
158
+		value.Info[i].Dest_fd = rawinfo.Dest_fd
159
+		value.Info[i].Dest_offset = rawinfo.Dest_offset
160
+		value.Info[i].Bytes_deduped = rawinfo.Bytes_deduped
161
+		value.Info[i].Status = rawinfo.Status
162
+		value.Info[i].Reserved = rawinfo.Reserved
163
+	}
164
+
165
+	return err
166
+}
167
+
168
+func IoctlHIDGetDesc(fd int, value *HIDRawReportDescriptor) error {
169
+	err := ioctl(fd, HIDIOCGRDESC, uintptr(unsafe.Pointer(value)))
170
+	runtime.KeepAlive(value)
171
+	return err
172
+}
173
+
174
+func IoctlHIDGetRawInfo(fd int) (*HIDRawDevInfo, error) {
175
+	var value HIDRawDevInfo
176
+	err := ioctl(fd, HIDIOCGRAWINFO, uintptr(unsafe.Pointer(&value)))
177
+	return &value, err
178
+}
179
+
180
+func IoctlHIDGetRawName(fd int) (string, error) {
181
+	var value [_HIDIOCGRAWNAME_LEN]byte
182
+	err := ioctl(fd, _HIDIOCGRAWNAME, uintptr(unsafe.Pointer(&value[0])))
183
+	return ByteSliceToString(value[:]), err
184
+}
185
+
186
+func IoctlHIDGetRawPhys(fd int) (string, error) {
187
+	var value [_HIDIOCGRAWPHYS_LEN]byte
188
+	err := ioctl(fd, _HIDIOCGRAWPHYS, uintptr(unsafe.Pointer(&value[0])))
189
+	return ByteSliceToString(value[:]), err
190
+}
191
+
192
+func IoctlHIDGetRawUniq(fd int) (string, error) {
193
+	var value [_HIDIOCGRAWUNIQ_LEN]byte
194
+	err := ioctl(fd, _HIDIOCGRAWUNIQ, uintptr(unsafe.Pointer(&value[0])))
195
+	return ByteSliceToString(value[:]), err
196
+}

+ 74
- 0
vendor/golang.org/x/sys/unix/ioctl_zos.go View File

@@ -0,0 +1,74 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build zos && s390x
6
+// +build zos,s390x
7
+
8
+package unix
9
+
10
+import (
11
+	"runtime"
12
+	"unsafe"
13
+)
14
+
15
+// ioctl itself should not be exposed directly, but additional get/set
16
+// functions for specific types are permissible.
17
+
18
+// IoctlSetInt performs an ioctl operation which sets an integer value
19
+// on fd, using the specified request number.
20
+func IoctlSetInt(fd int, req uint, value int) error {
21
+	return ioctl(fd, req, uintptr(value))
22
+}
23
+
24
+// IoctlSetWinsize performs an ioctl on fd with a *Winsize argument.
25
+//
26
+// To change fd's window size, the req argument should be TIOCSWINSZ.
27
+func IoctlSetWinsize(fd int, req uint, value *Winsize) error {
28
+	// TODO: if we get the chance, remove the req parameter and
29
+	// hardcode TIOCSWINSZ.
30
+	err := ioctl(fd, req, uintptr(unsafe.Pointer(value)))
31
+	runtime.KeepAlive(value)
32
+	return err
33
+}
34
+
35
+// IoctlSetTermios performs an ioctl on fd with a *Termios.
36
+//
37
+// The req value is expected to be TCSETS, TCSETSW, or TCSETSF
38
+func IoctlSetTermios(fd int, req uint, value *Termios) error {
39
+	if (req != TCSETS) && (req != TCSETSW) && (req != TCSETSF) {
40
+		return ENOSYS
41
+	}
42
+	err := Tcsetattr(fd, int(req), value)
43
+	runtime.KeepAlive(value)
44
+	return err
45
+}
46
+
47
+// IoctlGetInt performs an ioctl operation which gets an integer value
48
+// from fd, using the specified request number.
49
+//
50
+// A few ioctl requests use the return value as an output parameter;
51
+// for those, IoctlRetInt should be used instead of this function.
52
+func IoctlGetInt(fd int, req uint) (int, error) {
53
+	var value int
54
+	err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
55
+	return value, err
56
+}
57
+
58
+func IoctlGetWinsize(fd int, req uint) (*Winsize, error) {
59
+	var value Winsize
60
+	err := ioctl(fd, req, uintptr(unsafe.Pointer(&value)))
61
+	return &value, err
62
+}
63
+
64
+// IoctlGetTermios performs an ioctl on fd with a *Termios.
65
+//
66
+// The req value is expected to be TCGETS
67
+func IoctlGetTermios(fd int, req uint) (*Termios, error) {
68
+	var value Termios
69
+	if req != TCGETS {
70
+		return &value, ENOSYS
71
+	}
72
+	err := Tcgetattr(fd, &value)
73
+	return &value, err
74
+}

+ 1
- 13
vendor/golang.org/x/sys/unix/mkall.sh View File

@@ -70,23 +70,11 @@ aix_ppc64)
70 70
 	mksyscall="go run mksyscall_aix_ppc64.go -aix"
71 71
 	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
72 72
 	;;
73
-darwin_386)
74
-	mkerrors="$mkerrors -m32"
75
-	mksyscall="go run mksyscall.go -l32"
76
-	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
77
-	mkasm="go run mkasm_darwin.go"
78
-	;;
79 73
 darwin_amd64)
80 74
 	mkerrors="$mkerrors -m64"
81 75
 	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
82 76
 	mkasm="go run mkasm_darwin.go"
83 77
 	;;
84
-darwin_arm)
85
-	mkerrors="$mkerrors"
86
-	mksyscall="go run mksyscall.go -l32"
87
-	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
88
-	mkasm="go run mkasm_darwin.go"
89
-	;;
90 78
 darwin_arm64)
91 79
 	mkerrors="$mkerrors -m64"
92 80
 	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
@@ -199,7 +187,7 @@ illumos_amd64)
199 187
         mksyscall="go run mksyscall_solaris.go"
200 188
 	mkerrors=
201 189
 	mksysnum=
202
-	mktypes=
190
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
203 191
 	;;
204 192
 *)
205 193
 	echo 'unrecognized $GOOS_$GOARCH: ' "$GOOSARCH" 1>&2

+ 38
- 3
vendor/golang.org/x/sys/unix/mkerrors.sh View File

@@ -56,6 +56,7 @@ includes_Darwin='
56 56
 #define _DARWIN_C_SOURCE
57 57
 #define KERNEL
58 58
 #define _DARWIN_USE_64_BIT_INODE
59
+#define __APPLE_USE_RFC_3542
59 60
 #include <stdint.h>
60 61
 #include <sys/attr.h>
61 62
 #include <sys/clonefile.h>
@@ -65,6 +66,7 @@ includes_Darwin='
65 66
 #include <sys/ptrace.h>
66 67
 #include <sys/select.h>
67 68
 #include <sys/socket.h>
69
+#include <sys/un.h>
68 70
 #include <sys/sockio.h>
69 71
 #include <sys/sys_domain.h>
70 72
 #include <sys/sysctl.h>
@@ -114,6 +116,7 @@ includes_FreeBSD='
114 116
 #include <sys/sched.h>
115 117
 #include <sys/select.h>
116 118
 #include <sys/socket.h>
119
+#include <sys/un.h>
117 120
 #include <sys/sockio.h>
118 121
 #include <sys/stat.h>
119 122
 #include <sys/sysctl.h>
@@ -204,6 +207,7 @@ struct ltchars {
204 207
 #include <linux/devlink.h>
205 208
 #include <linux/dm-ioctl.h>
206 209
 #include <linux/errqueue.h>
210
+#include <linux/ethtool_netlink.h>
207 211
 #include <linux/falloc.h>
208 212
 #include <linux/fanotify.h>
209 213
 #include <linux/filter.h>
@@ -212,6 +216,8 @@ struct ltchars {
212 216
 #include <linux/fsverity.h>
213 217
 #include <linux/genetlink.h>
214 218
 #include <linux/hdreg.h>
219
+#include <linux/hidraw.h>
220
+#include <linux/icmp.h>
215 221
 #include <linux/icmpv6.h>
216 222
 #include <linux/if.h>
217 223
 #include <linux/if_addr.h>
@@ -222,6 +228,7 @@ struct ltchars {
222 228
 #include <linux/if_tun.h>
223 229
 #include <linux/if_packet.h>
224 230
 #include <linux/if_xdp.h>
231
+#include <linux/input.h>
225 232
 #include <linux/kexec.h>
226 233
 #include <linux/keyctl.h>
227 234
 #include <linux/loop.h>
@@ -232,6 +239,7 @@ struct ltchars {
232 239
 #include <linux/netfilter/nfnetlink.h>
233 240
 #include <linux/netlink.h>
234 241
 #include <linux/net_namespace.h>
242
+#include <linux/nfc.h>
235 243
 #include <linux/nsfs.h>
236 244
 #include <linux/perf_event.h>
237 245
 #include <linux/pps.h>
@@ -251,6 +259,7 @@ struct ltchars {
251 259
 #include <linux/watchdog.h>
252 260
 
253 261
 #include <mtd/ubi-user.h>
262
+#include <mtd/mtd-user.h>
254 263
 #include <net/route.h>
255 264
 
256 265
 #if defined(__sparc__)
@@ -298,6 +307,17 @@ struct ltchars {
298 307
 // Including linux/l2tp.h here causes conflicts between linux/in.h
299 308
 // and netinet/in.h included via net/route.h above.
300 309
 #define IPPROTO_L2TP		115
310
+
311
+// Copied from linux/hid.h.
312
+// Keep in sync with the size of the referenced fields.
313
+#define _HIDIOCGRAWNAME_LEN	128 // sizeof_field(struct hid_device, name)
314
+#define _HIDIOCGRAWPHYS_LEN	64  // sizeof_field(struct hid_device, phys)
315
+#define _HIDIOCGRAWUNIQ_LEN	64  // sizeof_field(struct hid_device, uniq)
316
+
317
+#define _HIDIOCGRAWNAME		HIDIOCGRAWNAME(_HIDIOCGRAWNAME_LEN)
318
+#define _HIDIOCGRAWPHYS		HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN)
319
+#define _HIDIOCGRAWUNIQ		HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN)
320
+
301 321
 '
302 322
 
303 323
 includes_NetBSD='
@@ -387,10 +407,11 @@ includes_SunOS='
387 407
 #include <net/if_arp.h>
388 408
 #include <net/if_types.h>
389 409
 #include <net/route.h>
410
+#include <netinet/icmp6.h>
390 411
 #include <netinet/in.h>
391
-#include <termios.h>
392 412
 #include <netinet/ip.h>
393 413
 #include <netinet/ip_mroute.h>
414
+#include <termios.h>
394 415
 '
395 416
 
396 417
 
@@ -445,6 +466,8 @@ ccflags="$@"
445 466
 		$2 !~ /^EPROC_/ &&
446 467
 		$2 !~ /^EQUIV_/ &&
447 468
 		$2 !~ /^EXPR_/ &&
469
+		$2 !~ /^EVIOC/ &&
470
+		$2 !~ /^EV_/ &&
448 471
 		$2 ~ /^E[A-Z0-9_]+$/ ||
449 472
 		$2 ~ /^B[0-9_]+$/ ||
450 473
 		$2 ~ /^(OLD|NEW)DEV$/ ||
@@ -479,10 +502,13 @@ ccflags="$@"
479 502
 		$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
480 503
 		$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
481 504
 		$2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ ||
482
-		$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|MCAST|EVFILT|NOTE|EV|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
505
+		$2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL)_/ ||
506
+		$2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ ||
507
+		$2 ~ /^NFC_.*_(MAX)?SIZE$/ ||
508
+		$2 ~ /^RAW_PAYLOAD_/ ||
483 509
 		$2 ~ /^TP_STATUS_/ ||
484 510
 		$2 ~ /^FALLOC_/ ||
485
-		$2 == "ICMPV6_FILTER" ||
511
+		$2 ~ /^ICMPV?6?_(FILTER|SEC)/ ||
486 512
 		$2 == "SOMAXCONN" ||
487 513
 		$2 == "NAME_MAX" ||
488 514
 		$2 == "IFNAMSIZ" ||
@@ -561,12 +587,20 @@ ccflags="$@"
561 587
 		$2 ~ /^(HDIO|WIN|SMART)_/ ||
562 588
 		$2 ~ /^CRYPTO_/ ||
563 589
 		$2 ~ /^TIPC_/ ||
590
+		$2 !~  "DEVLINK_RELOAD_LIMITS_VALID_MASK" &&
564 591
 		$2 ~ /^DEVLINK_/ ||
592
+		$2 ~ /^ETHTOOL_/ ||
565 593
 		$2 ~ /^LWTUNNEL_IP/ ||
566 594
 		$2 !~ "WMESGLEN" &&
567 595
 		$2 ~ /^W[A-Z0-9]+$/ ||
568 596
 		$2 ~/^PPPIOC/ ||
569 597
 		$2 ~ /^FAN_|FANOTIFY_/ ||
598
+		$2 == "HID_MAX_DESCRIPTOR_SIZE" ||
599
+		$2 ~ /^_?HIDIOC/ ||
600
+		$2 ~ /^BUS_(USB|HIL|BLUETOOTH|VIRTUAL)$/ ||
601
+		$2 ~ /^MTD/ ||
602
+		$2 ~ /^OTP/ ||
603
+		$2 ~ /^MEM/ ||
570 604
 		$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
571 605
 		$2 ~ /^__WCOREFLAG$/ {next}
572 606
 		$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
@@ -604,6 +638,7 @@ echo '#include <signal.h>' | $CC -x c - -E -dM $ccflags |
604 638
 echo '// mkerrors.sh' "$@"
605 639
 echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
606 640
 echo
641
+echo "//go:build ${GOARCH} && ${GOOS}"
607 642
 echo "// +build ${GOARCH},${GOOS}"
608 643
 echo
609 644
 go tool cgo -godefs -- "$@" _const.go >_error.out

+ 1
- 0
vendor/golang.org/x/sys/unix/pagesize_unix.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
5 6
 // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
6 7
 
7 8
 // For Unix, get the pagesize from the runtime.

+ 12
- 0
vendor/golang.org/x/sys/unix/ptrace_darwin.go View File

@@ -0,0 +1,12 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build darwin && !ios
6
+// +build darwin,!ios
7
+
8
+package unix
9
+
10
+func ptrace(request int, pid int, addr uintptr, data uintptr) error {
11
+	return ptrace1(request, pid, addr, data)
12
+}

+ 12
- 0
vendor/golang.org/x/sys/unix/ptrace_ios.go View File

@@ -0,0 +1,12 @@
1
+// Copyright 2020 The Go Authors. All rights reserved.
2
+// Use of this source code is governed by a BSD-style
3
+// license that can be found in the LICENSE file.
4
+
5
+//go:build ios
6
+// +build ios
7
+
8
+package unix
9
+
10
+func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) {
11
+	return ENOTSUP
12
+}

+ 1
- 0
vendor/golang.org/x/sys/unix/race.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build (darwin && race) || (linux && race) || (freebsd && race)
5 6
 // +build darwin,race linux,race freebsd,race
6 7
 
7 8
 package unix

+ 2
- 1
vendor/golang.org/x/sys/unix/race0.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly
5
+//go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
6
+// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos
6 7
 
7 8
 package unix
8 9
 

+ 1
- 0
vendor/golang.org/x/sys/unix/readdirent_getdents.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
5 6
 // +build aix dragonfly freebsd linux netbsd openbsd
6 7
 
7 8
 package unix

+ 1
- 0
vendor/golang.org/x/sys/unix/readdirent_getdirentries.go View File

@@ -2,6 +2,7 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
+//go:build darwin
5 6
 // +build darwin
6 7
 
7 8
 package unix

+ 2
- 1
vendor/golang.org/x/sys/unix/sockcmsg_unix.go View File

@@ -2,7 +2,8 @@
2 2
 // Use of this source code is governed by a BSD-style
3 3
 // license that can be found in the LICENSE file.
4 4
 
5
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
5
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
6
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
6 7
 
7 8
 // Socket control messages
8 9
 

+ 0
- 0
vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save