summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-05-18 07:32:31 -0700
committerGitHub <noreply@github.com>2018-05-18 07:32:31 -0700
commitd5e1f7e2982c2fcc888ccac550b34095efbee217 (patch)
treed8cfe7e3f47537cce92b26a1b32b9081f0bd7993 /vendor
parentd3ead7dc8535f8fa5b175686cc1f7669c8b1648b (diff)
downloadchat-d5e1f7e2982c2fcc888ccac550b34095efbee217.tar.gz
chat-d5e1f7e2982c2fcc888ccac550b34095efbee217.tar.bz2
chat-d5e1f7e2982c2fcc888ccac550b34095efbee217.zip
Upgrading server dependency. (#8807)
Diffstat (limited to 'vendor')
-rw-r--r--vendor/github.com/disintegration/imaging/helpers.go68
-rw-r--r--vendor/github.com/dustin/go-humanize/comma.go8
-rw-r--r--vendor/github.com/dustin/go-humanize/ftoa.go25
-rw-r--r--vendor/github.com/dustin/go-humanize/si.go10
-rw-r--r--vendor/github.com/dyatlov/go-opengraph/opengraph/opengraph.go113
-rw-r--r--vendor/github.com/go-ini/ini/ini.go7
-rw-r--r--vendor/github.com/go-ini/ini/parser.go84
-rw-r--r--vendor/github.com/golang/protobuf/proto/Makefile43
-rw-r--r--vendor/github.com/golang/protobuf/proto/clone.go46
-rw-r--r--vendor/github.com/golang/protobuf/proto/decode.go668
-rw-r--r--vendor/github.com/golang/protobuf/proto/discard.go201
-rw-r--r--vendor/github.com/golang/protobuf/proto/encode.go1191
-rw-r--r--vendor/github.com/golang/protobuf/proto/equal.go30
-rw-r--r--vendor/github.com/golang/protobuf/proto/extensions.go204
-rw-r--r--vendor/github.com/golang/protobuf/proto/lib.go70
-rw-r--r--vendor/github.com/golang/protobuf/proto/message_set.go81
-rw-r--r--vendor/github.com/golang/protobuf/proto/pointer_reflect.go595
-rw-r--r--vendor/github.com/golang/protobuf/proto/pointer_unsafe.go366
-rw-r--r--vendor/github.com/golang/protobuf/proto/properties.go424
-rw-r--r--vendor/github.com/golang/protobuf/proto/table_marshal.go2681
-rw-r--r--vendor/github.com/golang/protobuf/proto/table_merge.go654
-rw-r--r--vendor/github.com/golang/protobuf/proto/table_unmarshal.go1967
-rw-r--r--vendor/github.com/golang/protobuf/proto/text.go61
-rw-r--r--vendor/github.com/golang/protobuf/proto/text_parser.go77
-rw-r--r--vendor/github.com/gorilla/context/.travis.yml8
-rw-r--r--vendor/github.com/gorilla/context/README.md3
-rw-r--r--vendor/github.com/gorilla/context/doc.go6
-rw-r--r--vendor/github.com/gorilla/mux/.travis.yml11
-rw-r--r--vendor/github.com/gorilla/mux/README.md299
-rw-r--r--vendor/github.com/gorilla/mux/doc.go7
-rw-r--r--vendor/github.com/gorilla/mux/middleware.go52
-rw-r--r--vendor/github.com/gorilla/mux/mux.go9
-rw-r--r--vendor/github.com/gorilla/mux/route.go10
-rw-r--r--vendor/github.com/gorilla/mux/test_helpers.go3
-rw-r--r--vendor/github.com/gorilla/websocket/client.go2
-rw-r--r--vendor/github.com/gorilla/websocket/proxy.go2
-rw-r--r--vendor/github.com/gorilla/websocket/server.go10
-rw-r--r--vendor/github.com/hako/durafmt/README.md44
-rw-r--r--vendor/github.com/hako/durafmt/durafmt.go31
-rw-r--r--vendor/github.com/magiconair/properties/.travis.yml1
-rw-r--r--vendor/github.com/magiconair/properties/CHANGELOG.md8
-rw-r--r--vendor/github.com/magiconair/properties/README.md3
-rw-r--r--vendor/github.com/magiconair/properties/decode.go2
-rw-r--r--vendor/github.com/magiconair/properties/doc.go6
-rw-r--r--vendor/github.com/magiconair/properties/integrate.go2
-rw-r--r--vendor/github.com/magiconair/properties/lex.go2
-rw-r--r--vendor/github.com/magiconair/properties/load.go257
-rw-r--r--vendor/github.com/magiconair/properties/parser.go2
-rw-r--r--vendor/github.com/magiconair/properties/properties.go13
-rw-r--r--vendor/github.com/magiconair/properties/rangecheck.go2
-rw-r--r--vendor/github.com/miekg/dns/client.go93
-rw-r--r--vendor/github.com/miekg/dns/compress_generate.go28
-rw-r--r--vendor/github.com/miekg/dns/dns.go10
-rw-r--r--vendor/github.com/miekg/dns/dnssec.go5
-rw-r--r--vendor/github.com/miekg/dns/doc.go4
-rw-r--r--vendor/github.com/miekg/dns/msg.go127
-rw-r--r--vendor/github.com/miekg/dns/privaterr.go3
-rw-r--r--vendor/github.com/miekg/dns/scan_rr.go12
-rw-r--r--vendor/github.com/miekg/dns/server.go199
-rw-r--r--vendor/github.com/miekg/dns/types_generate.go2
-rw-r--r--vendor/github.com/miekg/dns/udp.go33
-rw-r--r--vendor/github.com/miekg/dns/version.go2
-rw-r--r--vendor/github.com/miekg/dns/zcompress.go165
-rw-r--r--vendor/github.com/miekg/dns/ztypes.go130
-rw-r--r--vendor/github.com/minio/minio-go/api-compose-object.go32
-rw-r--r--vendor/github.com/minio/minio-go/api-put-bucket.go6
-rw-r--r--vendor/github.com/minio/minio-go/api-put-object-copy.go28
-rw-r--r--vendor/github.com/minio/minio-go/api-put-object.go24
-rw-r--r--vendor/github.com/minio/minio-go/api-stat.go3
-rw-r--r--vendor/github.com/minio/minio-go/api.go2
-rw-r--r--vendor/github.com/minio/minio-go/constants.go7
-rw-r--r--vendor/github.com/minio/minio-go/core.go2
-rw-r--r--vendor/github.com/minio/minio-go/functional_tests.go49
-rw-r--r--vendor/github.com/minio/minio-go/retry.go1
-rw-r--r--vendor/github.com/minio/minio-go/utils.go1
-rw-r--r--vendor/github.com/mitchellh/mapstructure/mapstructure.go30
-rw-r--r--vendor/github.com/spf13/cobra/bash_completions.go29
-rw-r--r--vendor/github.com/spf13/cobra/bash_completions.md2
-rw-r--r--vendor/github.com/spf13/cobra/command.go10
-rw-r--r--vendor/go.uber.org/atomic/atomic.go42
-rw-r--r--vendor/golang.org/x/crypto/argon2/blamka_amd64.go7
-rw-r--r--vendor/golang.org/x/crypto/argon2/blamka_amd64.s9
-rw-r--r--vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go26
-rw-r--r--vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go7
-rw-r--r--vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s9
-rw-r--r--vendor/golang.org/x/net/bpf/instructions.go32
-rw-r--r--vendor/golang.org/x/net/html/atom/gen.go1
-rw-r--r--vendor/golang.org/x/net/html/atom/table.go1366
-rw-r--r--vendor/golang.org/x/net/html/const.go2
-rw-r--r--vendor/golang.org/x/net/html/foreign.go6
-rw-r--r--vendor/golang.org/x/net/html/node.go7
-rw-r--r--vendor/golang.org/x/net/html/parse.go76
-rw-r--r--vendor/golang.org/x/net/internal/iana/const.go51
-rw-r--r--vendor/golang.org/x/net/internal/iana/gen.go96
-rw-r--r--vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go6
-rw-r--r--vendor/golang.org/x/net/ipv4/gen.go2
-rw-r--r--vendor/golang.org/x/net/ipv4/iana.go10
-rw-r--r--vendor/golang.org/x/net/ipv6/gen.go2
-rw-r--r--vendor/golang.org/x/net/ipv6/iana.go10
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu.go35
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_arm.go7
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_arm64.go7
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_mips64x.go9
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_mipsx.go9
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_ppc64x.go9
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_s390x.go7
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_x86.go61
-rw-r--r--vendor/golang.org/x/sys/cpu/cpu_x86.s26
-rw-r--r--vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s10
-rw-r--r--vendor/golang.org/x/sys/unix/cap_freebsd.go30
-rwxr-xr-xvendor/golang.org/x/sys/unix/mkerrors.sh52
-rw-r--r--vendor/golang.org/x/sys/unix/mkpost.go6
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_darwin.go8
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux.go41
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_amd64.go17
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go2
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_openbsd.go4
-rw-r--r--vendor/golang.org/x/sys/unix/syscall_unix.go23
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_386.go286
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go286
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go286
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go286
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go278
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go270
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go270
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go270
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_386.go561
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go560
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm.go559
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go561
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips.go565
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go565
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go565
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go565
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go561
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go561
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go559
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go268
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go268
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go268
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go258
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go258
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go258
-rw-r--r--vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go336
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_386.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go37
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go17
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go17
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go11
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go21
-rw-r--r--vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go21
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_386.go427
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_arm.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips.go431
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go431
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go429
-rw-r--r--vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go431
-rw-r--r--vendor/golang.org/x/sys/windows/asm_windows_386.s4
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/.travis.yml2
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS7
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/client.go2
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/nodes_info.go3
-rwxr-xr-xvendor/gopkg.in/olivere/elastic.v5/run-es.sh2
-rw-r--r--vendor/gopkg.in/olivere/elastic.v5/search_queries_fsq.go13
176 files changed, 20165 insertions, 8779 deletions
diff --git a/vendor/github.com/disintegration/imaging/helpers.go b/vendor/github.com/disintegration/imaging/helpers.go
index 7193e473c..dcb4d7ebb 100644
--- a/vendor/github.com/disintegration/imaging/helpers.go
+++ b/vendor/github.com/disintegration/imaging/helpers.go
@@ -1,6 +1,7 @@
package imaging
import (
+ "bytes"
"errors"
"image"
"image/color"
@@ -46,6 +47,26 @@ func (f Format) String() string {
}
}
+var formatFromExt = map[string]Format{
+ ".jpg": JPEG,
+ ".jpeg": JPEG,
+ ".png": PNG,
+ ".tif": TIFF,
+ ".tiff": TIFF,
+ ".bmp": BMP,
+ ".gif": GIF,
+}
+
+// FormatFromFilename parses image format from filename extension:
+// "jpg" (or "jpeg"), "png", "gif", "tif" (or "tiff") and "bmp" are supported.
+func FormatFromFilename(filename string) (Format, error) {
+ ext := strings.ToLower(filepath.Ext(filename))
+ if f, ok := formatFromExt[ext]; ok {
+ return f, nil
+ }
+ return -1, ErrUnsupportedFormat
+}
+
var (
// ErrUnsupportedFormat means the given image format (or file extension) is unsupported.
ErrUnsupportedFormat = errors.New("imaging: unsupported image format")
@@ -199,22 +220,10 @@ func Encode(w io.Writer, img image.Image, format Format, opts ...EncodeOption) e
// err := imaging.Save(img, "out.jpg", imaging.JPEGQuality(80))
//
func Save(img image.Image, filename string, opts ...EncodeOption) (err error) {
- formats := map[string]Format{
- ".jpg": JPEG,
- ".jpeg": JPEG,
- ".png": PNG,
- ".tif": TIFF,
- ".tiff": TIFF,
- ".bmp": BMP,
- ".gif": GIF,
- }
-
- ext := strings.ToLower(filepath.Ext(filename))
- f, ok := formats[ext]
- if !ok {
- return ErrUnsupportedFormat
+ f, err := FormatFromFilename(filename)
+ if err != nil {
+ return err
}
-
file, err := fs.Create(filename)
if err != nil {
return err
@@ -236,33 +245,16 @@ func New(width, height int, fillColor color.Color) *image.NRGBA {
return &image.NRGBA{}
}
- dst := image.NewNRGBA(image.Rect(0, 0, width, height))
c := color.NRGBAModel.Convert(fillColor).(color.NRGBA)
-
- if c.R == 0 && c.G == 0 && c.B == 0 && c.A == 0 {
- return dst
+ if (c == color.NRGBA{0, 0, 0, 0}) {
+ return image.NewNRGBA(image.Rect(0, 0, width, height))
}
- // Fill the first row.
- i := 0
- for x := 0; x < width; x++ {
- dst.Pix[i+0] = c.R
- dst.Pix[i+1] = c.G
- dst.Pix[i+2] = c.B
- dst.Pix[i+3] = c.A
- i += 4
+ return &image.NRGBA{
+ Pix: bytes.Repeat([]byte{c.R, c.G, c.B, c.A}, width*height),
+ Stride: 4 * width,
+ Rect: image.Rect(0, 0, width, height),
}
-
- // Copy the first row to other rows.
- size := width * 4
- parallel(1, height, func(ys <-chan int) {
- for y := range ys {
- i = y * dst.Stride
- copy(dst.Pix[i:i+size], dst.Pix[0:size])
- }
- })
-
- return dst
}
// Clone returns a copy of the given image.
diff --git a/vendor/github.com/dustin/go-humanize/comma.go b/vendor/github.com/dustin/go-humanize/comma.go
index 13611aaab..520ae3e57 100644
--- a/vendor/github.com/dustin/go-humanize/comma.go
+++ b/vendor/github.com/dustin/go-humanize/comma.go
@@ -76,6 +76,14 @@ func Commaf(v float64) string {
return buf.String()
}
+// CommafWithDigits works like the Commaf but limits the resulting
+// string to the given number of decimal places.
+//
+// e.g. CommafWithDigits(834142.32, 1) -> 834,142.3
+func CommafWithDigits(f float64, decimals int) string {
+ return stripTrailingDigits(Commaf(f), decimals)
+}
+
// BigComma produces a string form of the given big.Int in base 10
// with commas after every three orders of magnitude.
func BigComma(b *big.Int) string {
diff --git a/vendor/github.com/dustin/go-humanize/ftoa.go b/vendor/github.com/dustin/go-humanize/ftoa.go
index c76190b10..1c62b640d 100644
--- a/vendor/github.com/dustin/go-humanize/ftoa.go
+++ b/vendor/github.com/dustin/go-humanize/ftoa.go
@@ -1,6 +1,9 @@
package humanize
-import "strconv"
+import (
+ "strconv"
+ "strings"
+)
func stripTrailingZeros(s string) string {
offset := len(s) - 1
@@ -17,7 +20,27 @@ func stripTrailingZeros(s string) string {
return s[:offset+1]
}
+func stripTrailingDigits(s string, digits int) string {
+ if i := strings.Index(s, "."); i >= 0 {
+ if digits <= 0 {
+ return s[:i]
+ }
+ i++
+ if i+digits >= len(s) {
+ return s
+ }
+ return s[:i+digits]
+ }
+ return s
+}
+
// Ftoa converts a float to a string with no trailing zeros.
func Ftoa(num float64) string {
return stripTrailingZeros(strconv.FormatFloat(num, 'f', 6, 64))
}
+
+// FtoaWithDigits converts a float to a string but limits the resulting string
+// to the given number of decimal places, and no trailing zeros.
+func FtoaWithDigits(num float64, digits int) string {
+ return stripTrailingZeros(stripTrailingDigits(strconv.FormatFloat(num, 'f', 6, 64), digits))
+}
diff --git a/vendor/github.com/dustin/go-humanize/si.go b/vendor/github.com/dustin/go-humanize/si.go
index b24e48169..ae659e0e4 100644
--- a/vendor/github.com/dustin/go-humanize/si.go
+++ b/vendor/github.com/dustin/go-humanize/si.go
@@ -93,6 +93,16 @@ func SI(input float64, unit string) string {
return Ftoa(value) + " " + prefix + unit
}
+// SIWithDigits works like SI but limits the resulting string to the
+// given number of decimal places.
+//
+// e.g. SIWithDigits(1000000, 0, "B") -> 1 MB
+// e.g. SIWithDigits(2.2345e-12, 2, "F") -> 2.23 pF
+func SIWithDigits(input float64, decimals int, unit string) string {
+ value, prefix := ComputeSI(input)
+ return FtoaWithDigits(value, decimals) + " " + prefix + unit
+}
+
var errInvalid = errors.New("invalid input")
// ParseSI parses an SI string back into the number and unit.
diff --git a/vendor/github.com/dyatlov/go-opengraph/opengraph/opengraph.go b/vendor/github.com/dyatlov/go-opengraph/opengraph/opengraph.go
index 21eccf0ae..96feb78a5 100644
--- a/vendor/github.com/dyatlov/go-opengraph/opengraph/opengraph.go
+++ b/vendor/github.com/dyatlov/go-opengraph/opengraph/opengraph.go
@@ -17,6 +17,7 @@ type Image struct {
Type string `json:"type"`
Width uint64 `json:"width"`
Height uint64 `json:"height"`
+ draft bool `json:"-"`
}
// Video defines Open Graph Video type
@@ -26,6 +27,7 @@ type Video struct {
Type string `json:"type"`
Width uint64 `json:"width"`
Height uint64 `json:"height"`
+ draft bool `json:"-"`
}
// Audio defines Open Graph Audio Type
@@ -33,6 +35,7 @@ type Audio struct {
URL string `json:"url"`
SecureURL string `json:"secure_url"`
Type string `json:"type"`
+ draft bool `json:"-"`
}
// Article contain Open Graph Article structure
@@ -133,6 +136,27 @@ func (og *OpenGraph) ProcessHTML(buffer io.Reader) error {
}
}
+func (og *OpenGraph) ensureHasVideo() {
+ if len(og.Videos) > 0 {
+ return
+ }
+ og.Videos = append(og.Videos, &Video{draft: true})
+}
+
+func (og *OpenGraph) ensureHasImage() {
+ if len(og.Images) > 0 {
+ return
+ }
+ og.Images = append(og.Images, &Image{draft: true})
+}
+
+func (og *OpenGraph) ensureHasAudio() {
+ if len(og.Audios) > 0 {
+ return
+ }
+ og.Audios = append(og.Audios, &Audio{draft: true})
+}
+
// ProcessMeta processes meta attributes and adds them to Open Graph structure if they are suitable for that
func (og *OpenGraph) ProcessMeta(metaAttrs map[string]string) {
switch metaAttrs["property"] {
@@ -160,61 +184,74 @@ func (og *OpenGraph) ProcessMeta(metaAttrs map[string]string) {
og.Locale = metaAttrs["content"]
case "og:locale:alternate":
og.LocalesAlternate = append(og.LocalesAlternate, metaAttrs["content"])
+ case "og:audio":
+ if len(og.Audios)>0 && og.Audios[len(og.Audios)-1].draft {
+ og.Audios[len(og.Audios)-1].URL = metaAttrs["content"]
+ og.Audios[len(og.Audios)-1].draft = false
+ } else {
+ og.Audios = append(og.Audios, &Audio{URL: metaAttrs["content"]})
+ }
+ case "og:audio:secure_url":
+ og.ensureHasAudio()
+ og.Audios[len(og.Audios)-1].SecureURL = metaAttrs["content"]
+ case "og:audio:type":
+ og.ensureHasAudio()
+ og.Audios[len(og.Audios)-1].Type = metaAttrs["content"]
case "og:image":
- og.Images = append(og.Images, &Image{URL: metaAttrs["content"]})
- case "og:image:url":
- if len(og.Images) > 0 {
+ if len(og.Images)>0 && og.Images[len(og.Images)-1].draft {
og.Images[len(og.Images)-1].URL = metaAttrs["content"]
+ og.Images[len(og.Images)-1].draft = false
+ } else {
+ og.Images = append(og.Images, &Image{URL: metaAttrs["content"]})
}
+ case "og:image:url":
+ og.ensureHasImage()
+ og.Images[len(og.Images)-1].URL = metaAttrs["content"]
case "og:image:secure_url":
- if len(og.Images) > 0 {
- og.Images[len(og.Images)-1].SecureURL = metaAttrs["content"]
- }
+ og.ensureHasImage()
+ og.Images[len(og.Images)-1].SecureURL = metaAttrs["content"]
case "og:image:type":
- if len(og.Images) > 0 {
- og.Images[len(og.Images)-1].Type = metaAttrs["content"]
- }
+ og.ensureHasImage()
+ og.Images[len(og.Images)-1].Type = metaAttrs["content"]
case "og:image:width":
- if len(og.Images) > 0 {
- w, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
- if err == nil {
- og.Images[len(og.Images)-1].Width = w
- }
+ w, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
+ if err == nil {
+ og.ensureHasImage()
+ og.Images[len(og.Images)-1].Width = w
}
case "og:image:height":
- if len(og.Images) > 0 {
- h, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
- if err == nil {
- og.Images[len(og.Images)-1].Height = h
- }
+ h, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
+ if err == nil {
+ og.ensureHasImage()
+ og.Images[len(og.Images)-1].Height = h
}
case "og:video":
- og.Videos = append(og.Videos, &Video{URL: metaAttrs["content"]})
- case "og:video:url":
- if len(og.Videos) > 0 {
+ if len(og.Videos)>0 && og.Videos[len(og.Videos)-1].draft {
og.Videos[len(og.Videos)-1].URL = metaAttrs["content"]
+ og.Videos[len(og.Videos)-1].draft = false
+ } else {
+ og.Videos = append(og.Videos, &Video{URL: metaAttrs["content"]})
}
+ case "og:video:url":
+ og.ensureHasVideo()
+ og.Videos[len(og.Videos)-1].URL = metaAttrs["content"]
case "og:video:secure_url":
- if len(og.Videos) > 0 {
- og.Videos[len(og.Videos)-1].SecureURL = metaAttrs["content"]
- }
+ og.ensureHasVideo()
+ og.Videos[len(og.Videos)-1].SecureURL = metaAttrs["content"]
case "og:video:type":
- if len(og.Videos) > 0 {
- og.Videos[len(og.Videos)-1].Type = metaAttrs["content"]
- }
+ og.ensureHasVideo()
+ og.Videos[len(og.Videos)-1].Type = metaAttrs["content"]
case "og:video:width":
- if len(og.Videos) > 0 {
- w, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
- if err == nil {
- og.Videos[len(og.Videos)-1].Width = w
- }
+ w, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
+ if err == nil {
+ og.ensureHasVideo()
+ og.Videos[len(og.Videos)-1].Width = w
}
case "og:video:height":
- if len(og.Videos) > 0 {
- h, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
- if err == nil {
- og.Videos[len(og.Videos)-1].Height = h
- }
+ h, err := strconv.ParseUint(metaAttrs["content"], 10, 64)
+ if err == nil {
+ og.ensureHasVideo()
+ og.Videos[len(og.Videos)-1].Height = h
}
default:
if og.isArticle {
diff --git a/vendor/github.com/go-ini/ini/ini.go b/vendor/github.com/go-ini/ini/ini.go
index ccba1ee52..d98353229 100644
--- a/vendor/github.com/go-ini/ini/ini.go
+++ b/vendor/github.com/go-ini/ini/ini.go
@@ -32,7 +32,7 @@ const (
// Maximum allowed depth when recursively substituing variable names.
_DEPTH_VALUES = 99
- _VERSION = "1.35.0"
+ _VERSION = "1.36.0"
)
// Version returns current package version literal.
@@ -140,6 +140,11 @@ type LoadOptions struct {
// AllowNestedValues indicates whether to allow AWS-like nested values.
// Docs: http://docs.aws.amazon.com/cli/latest/topic/config-vars.html#nested-values
AllowNestedValues bool
+ // AllowPythonMultilineValues indicates whether to allow Python-like multi-line values.
+ // Docs: https://docs.python.org/3/library/configparser.html#supported-ini-file-structure
+ // Relevant quote: Values can also span multiple lines, as long as they are indented deeper
+ // than the first line of the value.
+ AllowPythonMultilineValues bool
// UnescapeValueDoubleQuotes indicates whether to unescape double quotes inside value to regular format
// when value is surrounded by double quotes, e.g. key="a \"value\"" => key=a "value"
UnescapeValueDoubleQuotes bool
diff --git a/vendor/github.com/go-ini/ini/parser.go b/vendor/github.com/go-ini/ini/parser.go
index db3af8f00..826e893c0 100644
--- a/vendor/github.com/go-ini/ini/parser.go
+++ b/vendor/github.com/go-ini/ini/parser.go
@@ -19,11 +19,14 @@ import (
"bytes"
"fmt"
"io"
+ "regexp"
"strconv"
"strings"
"unicode"
)
+var pythonMultiline = regexp.MustCompile("^(\\s+)([^\n]+)")
+
type tokenType int
const (
@@ -194,7 +197,8 @@ func hasSurroundedQuote(in string, quote byte) bool {
}
func (p *parser) readValue(in []byte,
- ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols bool) (string, error) {
+ parserBufferSize int,
+ ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines bool) (string, error) {
line := strings.TrimLeftFunc(string(in), unicode.IsSpace)
if len(line) == 0 {
@@ -224,11 +228,13 @@ func (p *parser) readValue(in []byte,
return line[startIdx : pos+startIdx], nil
}
+ lastChar := line[len(line)-1]
// Won't be able to reach here if value only contains whitespace
line = strings.TrimSpace(line)
+ trimmedLastChar := line[len(line)-1]
// Check continuation lines when desired
- if !ignoreContinuation && line[len(line)-1] == '\\' {
+ if !ignoreContinuation && trimmedLastChar == '\\' {
return p.readContinuationLines(line[:len(line)-1])
}
@@ -252,7 +258,50 @@ func (p *parser) readValue(in []byte,
if strings.Contains(line, `\#`) {
line = strings.Replace(line, `\#`, "#", -1)
}
+ } else if allowPythonMultilines && lastChar == '\n' {
+ parserBufferPeekResult, _ := p.buf.Peek(parserBufferSize)
+ peekBuffer := bytes.NewBuffer(parserBufferPeekResult)
+
+ identSize := -1
+ val := line
+
+ for {
+ peekData, peekErr := peekBuffer.ReadBytes('\n')
+ if peekErr != nil {
+ if peekErr == io.EOF {
+ return val, nil
+ }
+ return "", peekErr
+ }
+
+ peekMatches := pythonMultiline.FindStringSubmatch(string(peekData))
+ if len(peekMatches) != 3 {
+ return val, nil
+ }
+
+ currentIdentSize := len(peekMatches[1])
+ // NOTE: Return if not a python-ini multi-line value.
+ if currentIdentSize < 0 {
+ return val, nil
+ }
+ identSize = currentIdentSize
+
+ // NOTE: Just advance the parser reader (buffer) in-sync with the peek buffer.
+ _, err := p.readUntil('\n')
+ if err != nil {
+ return "", err
+ }
+
+ val += fmt.Sprintf("\n%s", peekMatches[2])
+ }
+
+ // NOTE: If it was a Python multi-line value,
+ // return the appended value.
+ if identSize > 0 {
+ return val, nil
+ }
}
+
return line, nil
}
@@ -276,6 +325,29 @@ func (f *File) parse(reader io.Reader) (err error) {
var line []byte
var inUnparseableSection bool
+
+ // NOTE: Iterate and increase `currentPeekSize` until
+ // the size of the parser buffer is found.
+ // TODO: When Golang 1.10 is the lowest version supported,
+ // replace with `parserBufferSize := p.buf.Size()`.
+ parserBufferSize := 0
+ // NOTE: Peek 1kb at a time.
+ currentPeekSize := 1024
+
+ if f.options.AllowPythonMultilineValues {
+ for {
+ peekBytes, _ := p.buf.Peek(currentPeekSize)
+ peekBytesLength := len(peekBytes)
+
+ if parserBufferSize >= peekBytesLength {
+ break
+ }
+
+ currentPeekSize *= 2
+ parserBufferSize = peekBytesLength
+ }
+ }
+
for !p.isEOF {
line, err = p.readUntil('\n')
if err != nil {
@@ -352,10 +424,12 @@ func (f *File) parse(reader io.Reader) (err error) {
// Treat as boolean key when desired, and whole line is key name.
if IsErrDelimiterNotFound(err) && f.options.AllowBooleanKeys {
kname, err := p.readValue(line,
+ parserBufferSize,
f.options.IgnoreContinuation,
f.options.IgnoreInlineComment,
f.options.UnescapeValueDoubleQuotes,
- f.options.UnescapeValueCommentSymbols)
+ f.options.UnescapeValueCommentSymbols,
+ f.options.AllowPythonMultilineValues)
if err != nil {
return err
}
@@ -379,10 +453,12 @@ func (f *File) parse(reader io.Reader) (err error) {
}
value, err := p.readValue(line[offset:],
+ parserBufferSize,
f.options.IgnoreContinuation,
f.options.IgnoreInlineComment,
f.options.UnescapeValueDoubleQuotes,
- f.options.UnescapeValueCommentSymbols)
+ f.options.UnescapeValueCommentSymbols,
+ f.options.AllowPythonMultilineValues)
if err != nil {
return err
}
diff --git a/vendor/github.com/golang/protobuf/proto/Makefile b/vendor/github.com/golang/protobuf/proto/Makefile
deleted file mode 100644
index e2e0651a9..000000000
--- a/vendor/github.com/golang/protobuf/proto/Makefile
+++ /dev/null
@@ -1,43 +0,0 @@
-# Go support for Protocol Buffers - Google's data interchange format
-#
-# Copyright 2010 The Go Authors. All rights reserved.
-# https://github.com/golang/protobuf
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-install:
- go install
-
-test: install generate-test-pbs
- go test
-
-
-generate-test-pbs:
- make install
- make -C testdata
- protoc --go_out=Mtestdata/test.proto=github.com/golang/protobuf/proto/testdata,Mgoogle/protobuf/any.proto=github.com/golang/protobuf/ptypes/any:. proto3_proto/proto3.proto
- make
diff --git a/vendor/github.com/golang/protobuf/proto/clone.go b/vendor/github.com/golang/protobuf/proto/clone.go
index e392575b3..3cd3249f7 100644
--- a/vendor/github.com/golang/protobuf/proto/clone.go
+++ b/vendor/github.com/golang/protobuf/proto/clone.go
@@ -35,22 +35,39 @@
package proto
import (
+ "fmt"
"log"
"reflect"
"strings"
)
// Clone returns a deep copy of a protocol buffer.
-func Clone(pb Message) Message {
- in := reflect.ValueOf(pb)
+func Clone(src Message) Message {
+ in := reflect.ValueOf(src)
if in.IsNil() {
- return pb
+ return src
}
-
out := reflect.New(in.Type().Elem())
- // out is empty so a merge is a deep copy.
- mergeStruct(out.Elem(), in.Elem())
- return out.Interface().(Message)
+ dst := out.Interface().(Message)
+ Merge(dst, src)
+ return dst
+}
+
+// Merger is the interface representing objects that can merge messages of the same type.
+type Merger interface {
+ // Merge merges src into this message.
+ // Required and optional fields that are set in src will be set to that value in dst.
+ // Elements of repeated fields will be appended.
+ //
+ // Merge may panic if called with a different argument type than the receiver.
+ Merge(src Message)
+}
+
+// generatedMerger is the custom merge method that generated protos will have.
+// We must add this method since a generate Merge method will conflict with
+// many existing protos that have a Merge data field already defined.
+type generatedMerger interface {
+ XXX_Merge(src Message)
}
// Merge merges src into dst.
@@ -58,17 +75,24 @@ func Clone(pb Message) Message {
// Elements of repeated fields will be appended.
// Merge panics if src and dst are not the same type, or if dst is nil.
func Merge(dst, src Message) {
+ if m, ok := dst.(Merger); ok {
+ m.Merge(src)
+ return
+ }
+
in := reflect.ValueOf(src)
out := reflect.ValueOf(dst)
if out.IsNil() {
panic("proto: nil destination")
}
if in.Type() != out.Type() {
- // Explicit test prior to mergeStruct so that mistyped nils will fail
- panic("proto: type mismatch")
+ panic(fmt.Sprintf("proto.Merge(%T, %T) type mismatch", dst, src))
}
if in.IsNil() {
- // Merging nil into non-nil is a quiet no-op
+ return // Merge from nil src is a noop
+ }
+ if m, ok := dst.(generatedMerger); ok {
+ m.XXX_Merge(src)
return
}
mergeStruct(out.Elem(), in.Elem())
@@ -84,7 +108,7 @@ func mergeStruct(out, in reflect.Value) {
mergeAny(out.Field(i), in.Field(i), false, sprop.Prop[i])
}
- if emIn, ok := extendable(in.Addr().Interface()); ok {
+ if emIn, err := extendable(in.Addr().Interface()); err == nil {
emOut, _ := extendable(out.Addr().Interface())
mIn, muIn := emIn.extensionsRead()
if mIn != nil {
diff --git a/vendor/github.com/golang/protobuf/proto/decode.go b/vendor/github.com/golang/protobuf/proto/decode.go
index aa207298f..d9aa3c42d 100644
--- a/vendor/github.com/golang/protobuf/proto/decode.go
+++ b/vendor/github.com/golang/protobuf/proto/decode.go
@@ -39,8 +39,6 @@ import (
"errors"
"fmt"
"io"
- "os"
- "reflect"
)
// errOverflow is returned when an integer is too large to be represented.
@@ -50,10 +48,6 @@ var errOverflow = errors.New("proto: integer overflow")
// wire type is encountered. It does not get returned to user code.
var ErrInternalBadWireType = errors.New("proto: internal error: bad wiretype for oneof")
-// The fundamental decoders that interpret bytes on the wire.
-// Those that take integer types all return uint64 and are
-// therefore of type valueDecoder.
-
// DecodeVarint reads a varint-encoded integer from the slice.
// It returns the integer and the number of bytes consumed, or
// zero if there is not enough.
@@ -267,9 +261,6 @@ func (p *Buffer) DecodeZigzag32() (x uint64, err error) {
return
}
-// These are not ValueDecoders: they produce an array of bytes or a string.
-// bytes, embedded messages
-
// DecodeRawBytes reads a count-delimited byte buffer from the Buffer.
// This is the format used for the bytes protocol buffer
// type and for embedded messages.
@@ -311,81 +302,29 @@ func (p *Buffer) DecodeStringBytes() (s string, err error) {
return string(buf), nil
}
-// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
-// If the protocol buffer has extensions, and the field matches, add it as an extension.
-// Otherwise, if the XXX_unrecognized field exists, append the skipped data there.
-func (o *Buffer) skipAndSave(t reflect.Type, tag, wire int, base structPointer, unrecField field) error {
- oi := o.index
-
- err := o.skip(t, tag, wire)
- if err != nil {
- return err
- }
-
- if !unrecField.IsValid() {
- return nil
- }
-
- ptr := structPointer_Bytes(base, unrecField)
-
- // Add the skipped field to struct field
- obuf := o.buf
-
- o.buf = *ptr
- o.EncodeVarint(uint64(tag<<3 | wire))
- *ptr = append(o.buf, obuf[oi:o.index]...)
-
- o.buf = obuf
-
- return nil
-}
-
-// Skip the next item in the buffer. Its wire type is decoded and presented as an argument.
-func (o *Buffer) skip(t reflect.Type, tag, wire int) error {
-
- var u uint64
- var err error
-
- switch wire {
- case WireVarint:
- _, err = o.DecodeVarint()
- case WireFixed64:
- _, err = o.DecodeFixed64()
- case WireBytes:
- _, err = o.DecodeRawBytes(false)
- case WireFixed32:
- _, err = o.DecodeFixed32()
- case WireStartGroup:
- for {
- u, err = o.DecodeVarint()
- if err != nil {
- break
- }
- fwire := int(u & 0x7)
- if fwire == WireEndGroup {
- break
- }
- ftag := int(u >> 3)
- err = o.skip(t, ftag, fwire)
- if err != nil {
- break
- }
- }
- default:
- err = fmt.Errorf("proto: can't skip unknown wire type %d for %s", wire, t)
- }
- return err
-}
-
// Unmarshaler is the interface representing objects that can
-// unmarshal themselves. The method should reset the receiver before
-// decoding starts. The argument points to data that may be
+// unmarshal themselves. The argument points to data that may be
// overwritten, so implementations should not keep references to the
// buffer.
+// Unmarshal implementations should not clear the receiver.
+// Any unmarshaled data should be merged into the receiver.
+// Callers of Unmarshal that do not want to retain existing data
+// should Reset the receiver before calling Unmarshal.
type Unmarshaler interface {
Unmarshal([]byte) error
}
+// newUnmarshaler is the interface representing objects that can
+// unmarshal themselves. The semantics are identical to Unmarshaler.
+//
+// This exists to support protoc-gen-go generated messages.
+// The proto package will stop type-asserting to this interface in the future.
+//
+// DO NOT DEPEND ON THIS.
+type newUnmarshaler interface {
+ XXX_Unmarshal([]byte) error
+}
+
// Unmarshal parses the protocol buffer representation in buf and places the
// decoded result in pb. If the struct underlying pb does not match
// the data in buf, the results can be unpredictable.
@@ -395,7 +334,13 @@ type Unmarshaler interface {
// to preserve and append to existing data.
func Unmarshal(buf []byte, pb Message) error {
pb.Reset()
- return UnmarshalMerge(buf, pb)
+ if u, ok := pb.(newUnmarshaler); ok {
+ return u.XXX_Unmarshal(buf)
+ }
+ if u, ok := pb.(Unmarshaler); ok {
+ return u.Unmarshal(buf)
+ }
+ return NewBuffer(buf).Unmarshal(pb)
}
// UnmarshalMerge parses the protocol buffer representation in buf and
@@ -405,8 +350,16 @@ func Unmarshal(buf []byte, pb Message) error {
// UnmarshalMerge merges into existing data in pb.
// Most code should use Unmarshal instead.
func UnmarshalMerge(buf []byte, pb Message) error {
- // If the object can unmarshal itself, let it.
+ if u, ok := pb.(newUnmarshaler); ok {
+ return u.XXX_Unmarshal(buf)
+ }
if u, ok := pb.(Unmarshaler); ok {
+ // NOTE: The history of proto have unfortunately been inconsistent
+ // whether Unmarshaler should or should not implicitly clear itself.
+ // Some implementations do, most do not.
+ // Thus, calling this here may or may not do what people want.
+ //
+ // See https://github.com/golang/protobuf/issues/424
return u.Unmarshal(buf)
}
return NewBuffer(buf).Unmarshal(pb)
@@ -422,12 +375,17 @@ func (p *Buffer) DecodeMessage(pb Message) error {
}
// DecodeGroup reads a tag-delimited group from the Buffer.
+// StartGroup tag is already consumed. This function consumes
+// EndGroup tag.
func (p *Buffer) DecodeGroup(pb Message) error {
- typ, base, err := getbase(pb)
- if err != nil {
- return err
+ b := p.buf[p.index:]
+ x, y := findEndGroup(b)
+ if x < 0 {
+ return io.ErrUnexpectedEOF
}
- return p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), true, base)
+ err := Unmarshal(b[:x], pb)
+ p.index += y
+ return err
}
// Unmarshal parses the protocol buffer representation in the
@@ -438,533 +396,33 @@ func (p *Buffer) DecodeGroup(pb Message) error {
// Unlike proto.Unmarshal, this does not reset pb before starting to unmarshal.
func (p *Buffer) Unmarshal(pb Message) error {
// If the object can unmarshal itself, let it.
- if u, ok := pb.(Unmarshaler); ok {
- err := u.Unmarshal(p.buf[p.index:])
+ if u, ok := pb.(newUnmarshaler); ok {
+ err := u.XXX_Unmarshal(p.buf[p.index:])
p.index = len(p.buf)
return err
}
-
- typ, base, err := getbase(pb)
- if err != nil {
- return err
- }
-
- err = p.unmarshalType(typ.Elem(), GetProperties(typ.Elem()), false, base)
-
- if collectStats {
- stats.Decode++
- }
-
- return err
-}
-
-// unmarshalType does the work of unmarshaling a structure.
-func (o *Buffer) unmarshalType(st reflect.Type, prop *StructProperties, is_group bool, base structPointer) error {
- var state errorState
- required, reqFields := prop.reqCount, uint64(0)
-
- var err error
- for err == nil && o.index < len(o.buf) {
- oi := o.index
- var u uint64
- u, err = o.DecodeVarint()
- if err != nil {
- break
- }
- wire := int(u & 0x7)
- if wire == WireEndGroup {
- if is_group {
- if required > 0 {
- // Not enough information to determine the exact field.
- // (See below.)
- return &RequiredNotSetError{"{Unknown}"}
- }
- return nil // input is satisfied
- }
- return fmt.Errorf("proto: %s: wiretype end group for non-group", st)
- }
- tag := int(u >> 3)
- if tag <= 0 {
- return fmt.Errorf("proto: %s: illegal tag %d (wire type %d)", st, tag, wire)
- }
- fieldnum, ok := prop.decoderTags.get(tag)
- if !ok {
- // Maybe it's an extension?
- if prop.extendable {
- if e, _ := extendable(structPointer_Interface(base, st)); isExtensionField(e, int32(tag)) {
- if err = o.skip(st, tag, wire); err == nil {
- extmap := e.extensionsWrite()
- ext := extmap[int32(tag)] // may be missing
- ext.enc = append(ext.enc, o.buf[oi:o.index]...)
- extmap[int32(tag)] = ext
- }
- continue
- }
- }
- // Maybe it's a oneof?
- if prop.oneofUnmarshaler != nil {
- m := structPointer_Interface(base, st).(Message)
- // First return value indicates whether tag is a oneof field.
- ok, err = prop.oneofUnmarshaler(m, tag, wire, o)
- if err == ErrInternalBadWireType {
- // Map the error to something more descriptive.
- // Do the formatting here to save generated code space.
- err = fmt.Errorf("bad wiretype for oneof field in %T", m)
- }
- if ok {
- continue
- }
- }
- err = o.skipAndSave(st, tag, wire, base, prop.unrecField)
- continue
- }
- p := prop.Prop[fieldnum]
-
- if p.dec == nil {
- fmt.Fprintf(os.Stderr, "proto: no protobuf decoder for %s.%s\n", st, st.Field(fieldnum).Name)
- continue
- }
- dec := p.dec
- if wire != WireStartGroup && wire != p.WireType {
- if wire == WireBytes && p.packedDec != nil {
- // a packable field
- dec = p.packedDec
- } else {
- err = fmt.Errorf("proto: bad wiretype for field %s.%s: got wiretype %d, want %d", st, st.Field(fieldnum).Name, wire, p.WireType)
- continue
- }
- }
- decErr := dec(o, p, base)
- if decErr != nil && !state.shouldContinue(decErr, p) {
- err = decErr
- }
- if err == nil && p.Required {
- // Successfully decoded a required field.
- if tag <= 64 {
- // use bitmap for fields 1-64 to catch field reuse.
- var mask uint64 = 1 << uint64(tag-1)
- if reqFields&mask == 0 {
- // new required field
- reqFields |= mask
- required--
- }
- } else {
- // This is imprecise. It can be fooled by a required field
- // with a tag > 64 that is encoded twice; that's very rare.
- // A fully correct implementation would require allocating
- // a data structure, which we would like to avoid.
- required--
- }
- }
- }
- if err == nil {
- if is_group {
- return io.ErrUnexpectedEOF
- }
- if state.err != nil {
- return state.err
- }
- if required > 0 {
- // Not enough information to determine the exact field. If we use extra
- // CPU, we could determine the field only if the missing required field
- // has a tag <= 64 and we check reqFields.
- return &RequiredNotSetError{"{Unknown}"}
- }
- }
- return err
-}
-
-// Individual type decoders
-// For each,
-// u is the decoded value,
-// v is a pointer to the field (pointer) in the struct
-
-// Sizes of the pools to allocate inside the Buffer.
-// The goal is modest amortization and allocation
-// on at least 16-byte boundaries.
-const (
- boolPoolSize = 16
- uint32PoolSize = 8
- uint64PoolSize = 4
-)
-
-// Decode a bool.
-func (o *Buffer) dec_bool(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- if len(o.bools) == 0 {
- o.bools = make([]bool, boolPoolSize)
- }
- o.bools[0] = u != 0
- *structPointer_Bool(base, p.field) = &o.bools[0]
- o.bools = o.bools[1:]
- return nil
-}
-
-func (o *Buffer) dec_proto3_bool(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- *structPointer_BoolVal(base, p.field) = u != 0
- return nil
-}
-
-// Decode an int32.
-func (o *Buffer) dec_int32(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- word32_Set(structPointer_Word32(base, p.field), o, uint32(u))
- return nil
-}
-
-func (o *Buffer) dec_proto3_int32(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- word32Val_Set(structPointer_Word32Val(base, p.field), uint32(u))
- return nil
-}
-
-// Decode an int64.
-func (o *Buffer) dec_int64(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- word64_Set(structPointer_Word64(base, p.field), o, u)
- return nil
-}
-
-func (o *Buffer) dec_proto3_int64(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- word64Val_Set(structPointer_Word64Val(base, p.field), o, u)
- return nil
-}
-
-// Decode a string.
-func (o *Buffer) dec_string(p *Properties, base structPointer) error {
- s, err := o.DecodeStringBytes()
- if err != nil {
- return err
- }
- *structPointer_String(base, p.field) = &s
- return nil
-}
-
-func (o *Buffer) dec_proto3_string(p *Properties, base structPointer) error {
- s, err := o.DecodeStringBytes()
- if err != nil {
- return err
- }
- *structPointer_StringVal(base, p.field) = s
- return nil
-}
-
-// Decode a slice of bytes ([]byte).
-func (o *Buffer) dec_slice_byte(p *Properties, base structPointer) error {
- b, err := o.DecodeRawBytes(true)
- if err != nil {
- return err
- }
- *structPointer_Bytes(base, p.field) = b
- return nil
-}
-
-// Decode a slice of bools ([]bool).
-func (o *Buffer) dec_slice_bool(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- v := structPointer_BoolSlice(base, p.field)
- *v = append(*v, u != 0)
- return nil
-}
-
-// Decode a slice of bools ([]bool) in packed format.
-func (o *Buffer) dec_slice_packed_bool(p *Properties, base structPointer) error {
- v := structPointer_BoolSlice(base, p.field)
-
- nn, err := o.DecodeVarint()
- if err != nil {
- return err
- }
- nb := int(nn) // number of bytes of encoded bools
- fin := o.index + nb
- if fin < o.index {
- return errOverflow
- }
-
- y := *v
- for o.index < fin {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- y = append(y, u != 0)
- }
-
- *v = y
- return nil
-}
-
-// Decode a slice of int32s ([]int32).
-func (o *Buffer) dec_slice_int32(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- structPointer_Word32Slice(base, p.field).Append(uint32(u))
- return nil
-}
-
-// Decode a slice of int32s ([]int32) in packed format.
-func (o *Buffer) dec_slice_packed_int32(p *Properties, base structPointer) error {
- v := structPointer_Word32Slice(base, p.field)
-
- nn, err := o.DecodeVarint()
- if err != nil {
- return err
- }
- nb := int(nn) // number of bytes of encoded int32s
-
- fin := o.index + nb
- if fin < o.index {
- return errOverflow
- }
- for o.index < fin {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- v.Append(uint32(u))
- }
- return nil
-}
-
-// Decode a slice of int64s ([]int64).
-func (o *Buffer) dec_slice_int64(p *Properties, base structPointer) error {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
-
- structPointer_Word64Slice(base, p.field).Append(u)
- return nil
-}
-
-// Decode a slice of int64s ([]int64) in packed format.
-func (o *Buffer) dec_slice_packed_int64(p *Properties, base structPointer) error {
- v := structPointer_Word64Slice(base, p.field)
-
- nn, err := o.DecodeVarint()
- if err != nil {
- return err
- }
- nb := int(nn) // number of bytes of encoded int64s
-
- fin := o.index + nb
- if fin < o.index {
- return errOverflow
- }
- for o.index < fin {
- u, err := p.valDec(o)
- if err != nil {
- return err
- }
- v.Append(u)
- }
- return nil
-}
-
-// Decode a slice of strings ([]string).
-func (o *Buffer) dec_slice_string(p *Properties, base structPointer) error {
- s, err := o.DecodeStringBytes()
- if err != nil {
- return err
- }
- v := structPointer_StringSlice(base, p.field)
- *v = append(*v, s)
- return nil
-}
-
-// Decode a slice of slice of bytes ([][]byte).
-func (o *Buffer) dec_slice_slice_byte(p *Properties, base structPointer) error {
- b, err := o.DecodeRawBytes(true)
- if err != nil {
- return err
- }
- v := structPointer_BytesSlice(base, p.field)
- *v = append(*v, b)
- return nil
-}
-
-// Decode a map field.
-func (o *Buffer) dec_new_map(p *Properties, base structPointer) error {
- raw, err := o.DecodeRawBytes(false)
- if err != nil {
- return err
- }
- oi := o.index // index at the end of this map entry
- o.index -= len(raw) // move buffer back to start of map entry
-
- mptr := structPointer_NewAt(base, p.field, p.mtype) // *map[K]V
- if mptr.Elem().IsNil() {
- mptr.Elem().Set(reflect.MakeMap(mptr.Type().Elem()))
- }
- v := mptr.Elem() // map[K]V
-
- // Prepare addressable doubly-indirect placeholders for the key and value types.
- // See enc_new_map for why.
- keyptr := reflect.New(reflect.PtrTo(p.mtype.Key())).Elem() // addressable *K
- keybase := toStructPointer(keyptr.Addr()) // **K
-
- var valbase structPointer
- var valptr reflect.Value
- switch p.mtype.Elem().Kind() {
- case reflect.Slice:
- // []byte
- var dummy []byte
- valptr = reflect.ValueOf(&dummy) // *[]byte
- valbase = toStructPointer(valptr) // *[]byte
- case reflect.Ptr:
- // message; valptr is **Msg; need to allocate the intermediate pointer
- valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
- valptr.Set(reflect.New(valptr.Type().Elem()))
- valbase = toStructPointer(valptr)
- default:
- // everything else
- valptr = reflect.New(reflect.PtrTo(p.mtype.Elem())).Elem() // addressable *V
- valbase = toStructPointer(valptr.Addr()) // **V
- }
-
- // Decode.
- // This parses a restricted wire format, namely the encoding of a message
- // with two fields. See enc_new_map for the format.
- for o.index < oi {
- // tagcode for key and value properties are always a single byte
- // because they have tags 1 and 2.
- tagcode := o.buf[o.index]
- o.index++
- switch tagcode {
- case p.mkeyprop.tagcode[0]:
- if err := p.mkeyprop.dec(o, p.mkeyprop, keybase); err != nil {
- return err
- }
- case p.mvalprop.tagcode[0]:
- if err := p.mvalprop.dec(o, p.mvalprop, valbase); err != nil {
- return err
- }
- default:
- // TODO: Should we silently skip this instead?
- return fmt.Errorf("proto: bad map data tag %d", raw[0])
- }
- }
- keyelem, valelem := keyptr.Elem(), valptr.Elem()
- if !keyelem.IsValid() {
- keyelem = reflect.Zero(p.mtype.Key())
- }
- if !valelem.IsValid() {
- valelem = reflect.Zero(p.mtype.Elem())
- }
-
- v.SetMapIndex(keyelem, valelem)
- return nil
-}
-
-// Decode a group.
-func (o *Buffer) dec_struct_group(p *Properties, base structPointer) error {
- bas := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(bas) {
- // allocate new nested message
- bas = toStructPointer(reflect.New(p.stype))
- structPointer_SetStructPointer(base, p.field, bas)
- }
- return o.unmarshalType(p.stype, p.sprop, true, bas)
-}
-
-// Decode an embedded message.
-func (o *Buffer) dec_struct_message(p *Properties, base structPointer) (err error) {
- raw, e := o.DecodeRawBytes(false)
- if e != nil {
- return e
- }
-
- bas := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(bas) {
- // allocate new nested message
- bas = toStructPointer(reflect.New(p.stype))
- structPointer_SetStructPointer(base, p.field, bas)
- }
-
- // If the object can unmarshal itself, let it.
- if p.isUnmarshaler {
- iv := structPointer_Interface(bas, p.stype)
- return iv.(Unmarshaler).Unmarshal(raw)
- }
-
- obuf := o.buf
- oi := o.index
- o.buf = raw
- o.index = 0
-
- err = o.unmarshalType(p.stype, p.sprop, false, bas)
- o.buf = obuf
- o.index = oi
-
- return err
-}
-
-// Decode a slice of embedded messages.
-func (o *Buffer) dec_slice_struct_message(p *Properties, base structPointer) error {
- return o.dec_slice_struct(p, false, base)
-}
-
-// Decode a slice of embedded groups.
-func (o *Buffer) dec_slice_struct_group(p *Properties, base structPointer) error {
- return o.dec_slice_struct(p, true, base)
-}
-
-// Decode a slice of structs ([]*struct).
-func (o *Buffer) dec_slice_struct(p *Properties, is_group bool, base structPointer) error {
- v := reflect.New(p.stype)
- bas := toStructPointer(v)
- structPointer_StructPointerSlice(base, p.field).Append(bas)
-
- if is_group {
- err := o.unmarshalType(p.stype, p.sprop, is_group, bas)
- return err
- }
-
- raw, err := o.DecodeRawBytes(false)
- if err != nil {
+ if u, ok := pb.(Unmarshaler); ok {
+ // NOTE: The history of proto have unfortunately been inconsistent
+ // whether Unmarshaler should or should not implicitly clear itself.
+ // Some implementations do, most do not.
+ // Thus, calling this here may or may not do what people want.
+ //
+ // See https://github.com/golang/protobuf/issues/424
+ err := u.Unmarshal(p.buf[p.index:])
+ p.index = len(p.buf)
return err
}
- // If the object can unmarshal itself, let it.
- if p.isUnmarshaler {
- iv := v.Interface()
- return iv.(Unmarshaler).Unmarshal(raw)
- }
-
- obuf := o.buf
- oi := o.index
- o.buf = raw
- o.index = 0
-
- err = o.unmarshalType(p.stype, p.sprop, is_group, bas)
-
- o.buf = obuf
- o.index = oi
-
+ // Slow workaround for messages that aren't Unmarshalers.
+ // This includes some hand-coded .pb.go files and
+ // bootstrap protos.
+ // TODO: fix all of those and then add Unmarshal to
+ // the Message interface. Then:
+ // The cast above and code below can be deleted.
+ // The old unmarshaler can be deleted.
+ // Clients can call Unmarshal directly (can already do that, actually).
+ var info InternalMessageInfo
+ err := info.Unmarshal(pb, p.buf[p.index:])
+ p.index = len(p.buf)
return err
}
diff --git a/vendor/github.com/golang/protobuf/proto/discard.go b/vendor/github.com/golang/protobuf/proto/discard.go
index bd0e3bb4c..dea2617ce 100644
--- a/vendor/github.com/golang/protobuf/proto/discard.go
+++ b/vendor/github.com/golang/protobuf/proto/discard.go
@@ -35,8 +35,14 @@ import (
"fmt"
"reflect"
"strings"
+ "sync"
+ "sync/atomic"
)
+type generatedDiscarder interface {
+ XXX_DiscardUnknown()
+}
+
// DiscardUnknown recursively discards all unknown fields from this message
// and all embedded messages.
//
@@ -49,9 +55,202 @@ import (
// For proto2 messages, the unknown fields of message extensions are only
// discarded from messages that have been accessed via GetExtension.
func DiscardUnknown(m Message) {
+ if m, ok := m.(generatedDiscarder); ok {
+ m.XXX_DiscardUnknown()
+ return
+ }
+ // TODO: Dynamically populate a InternalMessageInfo for legacy messages,
+ // but the master branch has no implementation for InternalMessageInfo,
+ // so it would be more work to replicate that approach.
discardLegacy(m)
}
+// DiscardUnknown recursively discards all unknown fields.
+func (a *InternalMessageInfo) DiscardUnknown(m Message) {
+ di := atomicLoadDiscardInfo(&a.discard)
+ if di == nil {
+ di = getDiscardInfo(reflect.TypeOf(m).Elem())
+ atomicStoreDiscardInfo(&a.discard, di)
+ }
+ di.discard(toPointer(&m))
+}
+
+type discardInfo struct {
+ typ reflect.Type
+
+ initialized int32 // 0: only typ is valid, 1: everything is valid
+ lock sync.Mutex
+
+ fields []discardFieldInfo
+ unrecognized field
+}
+
+type discardFieldInfo struct {
+ field field // Offset of field, guaranteed to be valid
+ discard func(src pointer)
+}
+
+var (
+ discardInfoMap = map[reflect.Type]*discardInfo{}
+ discardInfoLock sync.Mutex
+)
+
+func getDiscardInfo(t reflect.Type) *discardInfo {
+ discardInfoLock.Lock()
+ defer discardInfoLock.Unlock()
+ di := discardInfoMap[t]
+ if di == nil {
+ di = &discardInfo{typ: t}
+ discardInfoMap[t] = di
+ }
+ return di
+}
+
+func (di *discardInfo) discard(src pointer) {
+ if src.isNil() {
+ return // Nothing to do.
+ }
+
+ if atomic.LoadInt32(&di.initialized) == 0 {
+ di.computeDiscardInfo()
+ }
+
+ for _, fi := range di.fields {
+ sfp := src.offset(fi.field)
+ fi.discard(sfp)
+ }
+
+ // For proto2 messages, only discard unknown fields in message extensions
+ // that have been accessed via GetExtension.
+ if em, err := extendable(src.asPointerTo(di.typ).Interface()); err == nil {
+ // Ignore lock since DiscardUnknown is not concurrency safe.
+ emm, _ := em.extensionsRead()
+ for _, mx := range emm {
+ if m, ok := mx.value.(Message); ok {
+ DiscardUnknown(m)
+ }
+ }
+ }
+
+ if di.unrecognized.IsValid() {
+ *src.offset(di.unrecognized).toBytes() = nil
+ }
+}
+
+func (di *discardInfo) computeDiscardInfo() {
+ di.lock.Lock()
+ defer di.lock.Unlock()
+ if di.initialized != 0 {
+ return
+ }
+ t := di.typ
+ n := t.NumField()
+
+ for i := 0; i < n; i++ {
+ f := t.Field(i)
+ if strings.HasPrefix(f.Name, "XXX_") {
+ continue
+ }
+
+ dfi := discardFieldInfo{field: toField(&f)}
+ tf := f.Type
+
+ // Unwrap tf to get its most basic type.
+ var isPointer, isSlice bool
+ if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
+ isSlice = true
+ tf = tf.Elem()
+ }
+ if tf.Kind() == reflect.Ptr {
+ isPointer = true
+ tf = tf.Elem()
+ }
+ if isPointer && isSlice && tf.Kind() != reflect.Struct {
+ panic(fmt.Sprintf("%v.%s cannot be a slice of pointers to primitive types", t, f.Name))
+ }
+
+ switch tf.Kind() {
+ case reflect.Struct:
+ switch {
+ case !isPointer:
+ panic(fmt.Sprintf("%v.%s cannot be a direct struct value", t, f.Name))
+ case isSlice: // E.g., []*pb.T
+ di := getDiscardInfo(tf)
+ dfi.discard = func(src pointer) {
+ sps := src.getPointerSlice()
+ for _, sp := range sps {
+ if !sp.isNil() {
+ di.discard(sp)
+ }
+ }
+ }
+ default: // E.g., *pb.T
+ di := getDiscardInfo(tf)
+ dfi.discard = func(src pointer) {
+ sp := src.getPointer()
+ if !sp.isNil() {
+ di.discard(sp)
+ }
+ }
+ }
+ case reflect.Map:
+ switch {
+ case isPointer || isSlice:
+ panic(fmt.Sprintf("%v.%s cannot be a pointer to a map or a slice of map values", t, f.Name))
+ default: // E.g., map[K]V
+ if tf.Elem().Kind() == reflect.Ptr { // Proto struct (e.g., *T)
+ dfi.discard = func(src pointer) {
+ sm := src.asPointerTo(tf).Elem()
+ if sm.Len() == 0 {
+ return
+ }
+ for _, key := range sm.MapKeys() {
+ val := sm.MapIndex(key)
+ DiscardUnknown(val.Interface().(Message))
+ }
+ }
+ } else {
+ dfi.discard = func(pointer) {} // Noop
+ }
+ }
+ case reflect.Interface:
+ // Must be oneof field.
+ switch {
+ case isPointer || isSlice:
+ panic(fmt.Sprintf("%v.%s cannot be a pointer to a interface or a slice of interface values", t, f.Name))
+ default: // E.g., interface{}
+ // TODO: Make this faster?
+ dfi.discard = func(src pointer) {
+ su := src.asPointerTo(tf).Elem()
+ if !su.IsNil() {
+ sv := su.Elem().Elem().Field(0)
+ if sv.Kind() == reflect.Ptr && sv.IsNil() {
+ return
+ }
+ switch sv.Type().Kind() {
+ case reflect.Ptr: // Proto struct (e.g., *T)
+ DiscardUnknown(sv.Interface().(Message))
+ }
+ }
+ }
+ }
+ default:
+ continue
+ }
+ di.fields = append(di.fields, dfi)
+ }
+
+ di.unrecognized = invalidField
+ if f, ok := t.FieldByName("XXX_unrecognized"); ok {
+ if f.Type != reflect.TypeOf([]byte{}) {
+ panic("expected XXX_unrecognized to be of type []byte")
+ }
+ di.unrecognized = toField(&f)
+ }
+
+ atomic.StoreInt32(&di.initialized, 1)
+}
+
func discardLegacy(m Message) {
v := reflect.ValueOf(m)
if v.Kind() != reflect.Ptr || v.IsNil() {
@@ -139,7 +338,7 @@ func discardLegacy(m Message) {
// For proto2 messages, only discard unknown fields in message extensions
// that have been accessed via GetExtension.
- if em, ok := extendable(m); ok {
+ if em, err := extendable(m); err == nil {
// Ignore lock since discardLegacy is not concurrency safe.
emm, _ := em.extensionsRead()
for _, mx := range emm {
diff --git a/vendor/github.com/golang/protobuf/proto/encode.go b/vendor/github.com/golang/protobuf/proto/encode.go
index 8b84d1b22..c27d35f86 100644
--- a/vendor/github.com/golang/protobuf/proto/encode.go
+++ b/vendor/github.com/golang/protobuf/proto/encode.go
@@ -39,7 +39,6 @@ import (
"errors"
"fmt"
"reflect"
- "sort"
)
// RequiredNotSetError is the error returned if Marshal is called with
@@ -82,10 +81,6 @@ var (
const maxVarintBytes = 10 // maximum length of a varint
-// maxMarshalSize is the largest allowed size of an encoded protobuf,
-// since C++ and Java use signed int32s for the size.
-const maxMarshalSize = 1<<31 - 1
-
// EncodeVarint returns the varint encoding of x.
// This is the format for the
// int32, int64, uint32, uint64, bool, and enum
@@ -119,18 +114,27 @@ func (p *Buffer) EncodeVarint(x uint64) error {
// SizeVarint returns the varint encoding size of an integer.
func SizeVarint(x uint64) int {
- return sizeVarint(x)
-}
-
-func sizeVarint(x uint64) (n int) {
- for {
- n++
- x >>= 7
- if x == 0 {
- break
- }
- }
- return n
+ switch {
+ case x < 1<<7:
+ return 1
+ case x < 1<<14:
+ return 2
+ case x < 1<<21:
+ return 3
+ case x < 1<<28:
+ return 4
+ case x < 1<<35:
+ return 5
+ case x < 1<<42:
+ return 6
+ case x < 1<<49:
+ return 7
+ case x < 1<<56:
+ return 8
+ case x < 1<<63:
+ return 9
+ }
+ return 10
}
// EncodeFixed64 writes a 64-bit integer to the Buffer.
@@ -149,10 +153,6 @@ func (p *Buffer) EncodeFixed64(x uint64) error {
return nil
}
-func sizeFixed64(x uint64) int {
- return 8
-}
-
// EncodeFixed32 writes a 32-bit integer to the Buffer.
// This is the format for the
// fixed32, sfixed32, and float protocol buffer types.
@@ -165,20 +165,12 @@ func (p *Buffer) EncodeFixed32(x uint64) error {
return nil
}
-func sizeFixed32(x uint64) int {
- return 4
-}
-
// EncodeZigzag64 writes a zigzag-encoded 64-bit integer
// to the Buffer.
// This is the format used for the sint64 protocol buffer type.
func (p *Buffer) EncodeZigzag64(x uint64) error {
// use signed number to get arithmetic right shift.
- return p.EncodeVarint((x << 1) ^ uint64((int64(x) >> 63)))
-}
-
-func sizeZigzag64(x uint64) int {
- return sizeVarint((x << 1) ^ uint64((int64(x) >> 63)))
+ return p.EncodeVarint(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
// EncodeZigzag32 writes a zigzag-encoded 32-bit integer
@@ -189,10 +181,6 @@ func (p *Buffer) EncodeZigzag32(x uint64) error {
return p.EncodeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))
}
-func sizeZigzag32(x uint64) int {
- return sizeVarint(uint64((uint32(x) << 1) ^ uint32((int32(x) >> 31))))
-}
-
// EncodeRawBytes writes a count-delimited byte buffer to the Buffer.
// This is the format used for the bytes protocol buffer
// type and for embedded messages.
@@ -202,11 +190,6 @@ func (p *Buffer) EncodeRawBytes(b []byte) error {
return nil
}
-func sizeRawBytes(b []byte) int {
- return sizeVarint(uint64(len(b))) +
- len(b)
-}
-
// EncodeStringBytes writes an encoded string to the Buffer.
// This is the format used for the proto2 string type.
func (p *Buffer) EncodeStringBytes(s string) error {
@@ -215,319 +198,17 @@ func (p *Buffer) EncodeStringBytes(s string) error {
return nil
}
-func sizeStringBytes(s string) int {
- return sizeVarint(uint64(len(s))) +
- len(s)
-}
-
// Marshaler is the interface representing objects that can marshal themselves.
type Marshaler interface {
Marshal() ([]byte, error)
}
-// Marshal takes the protocol buffer
-// and encodes it into the wire format, returning the data.
-func Marshal(pb Message) ([]byte, error) {
- // Can the object marshal itself?
- if m, ok := pb.(Marshaler); ok {
- return m.Marshal()
- }
- p := NewBuffer(nil)
- err := p.Marshal(pb)
- if p.buf == nil && err == nil {
- // Return a non-nil slice on success.
- return []byte{}, nil
- }
- return p.buf, err
-}
-
// EncodeMessage writes the protocol buffer to the Buffer,
// prefixed by a varint-encoded length.
func (p *Buffer) EncodeMessage(pb Message) error {
- t, base, err := getbase(pb)
- if structPointer_IsNil(base) {
- return ErrNil
- }
- if err == nil {
- var state errorState
- err = p.enc_len_struct(GetProperties(t.Elem()), base, &state)
- }
- return err
-}
-
-// Marshal takes the protocol buffer
-// and encodes it into the wire format, writing the result to the
-// Buffer.
-func (p *Buffer) Marshal(pb Message) error {
- // Can the object marshal itself?
- if m, ok := pb.(Marshaler); ok {
- data, err := m.Marshal()
- p.buf = append(p.buf, data...)
- return err
- }
-
- t, base, err := getbase(pb)
- if structPointer_IsNil(base) {
- return ErrNil
- }
- if err == nil {
- err = p.enc_struct(GetProperties(t.Elem()), base)
- }
-
- if collectStats {
- (stats).Encode++ // Parens are to work around a goimports bug.
- }
-
- if len(p.buf) > maxMarshalSize {
- return ErrTooLarge
- }
- return err
-}
-
-// Size returns the encoded size of a protocol buffer.
-func Size(pb Message) (n int) {
- // Can the object marshal itself? If so, Size is slow.
- // TODO: add Size to Marshaler, or add a Sizer interface.
- if m, ok := pb.(Marshaler); ok {
- b, _ := m.Marshal()
- return len(b)
- }
-
- t, base, err := getbase(pb)
- if structPointer_IsNil(base) {
- return 0
- }
- if err == nil {
- n = size_struct(GetProperties(t.Elem()), base)
- }
-
- if collectStats {
- (stats).Size++ // Parens are to work around a goimports bug.
- }
-
- return
-}
-
-// Individual type encoders.
-
-// Encode a bool.
-func (o *Buffer) enc_bool(p *Properties, base structPointer) error {
- v := *structPointer_Bool(base, p.field)
- if v == nil {
- return ErrNil
- }
- x := 0
- if *v {
- x = 1
- }
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, uint64(x))
- return nil
-}
-
-func (o *Buffer) enc_proto3_bool(p *Properties, base structPointer) error {
- v := *structPointer_BoolVal(base, p.field)
- if !v {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, 1)
- return nil
-}
-
-func size_bool(p *Properties, base structPointer) int {
- v := *structPointer_Bool(base, p.field)
- if v == nil {
- return 0
- }
- return len(p.tagcode) + 1 // each bool takes exactly one byte
-}
-
-func size_proto3_bool(p *Properties, base structPointer) int {
- v := *structPointer_BoolVal(base, p.field)
- if !v && !p.oneof {
- return 0
- }
- return len(p.tagcode) + 1 // each bool takes exactly one byte
-}
-
-// Encode an int32.
-func (o *Buffer) enc_int32(p *Properties, base structPointer) error {
- v := structPointer_Word32(base, p.field)
- if word32_IsNil(v) {
- return ErrNil
- }
- x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, uint64(x))
- return nil
-}
-
-func (o *Buffer) enc_proto3_int32(p *Properties, base structPointer) error {
- v := structPointer_Word32Val(base, p.field)
- x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range
- if x == 0 {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, uint64(x))
- return nil
-}
-
-func size_int32(p *Properties, base structPointer) (n int) {
- v := structPointer_Word32(base, p.field)
- if word32_IsNil(v) {
- return 0
- }
- x := int32(word32_Get(v)) // permit sign extension to use full 64-bit range
- n += len(p.tagcode)
- n += p.valSize(uint64(x))
- return
-}
-
-func size_proto3_int32(p *Properties, base structPointer) (n int) {
- v := structPointer_Word32Val(base, p.field)
- x := int32(word32Val_Get(v)) // permit sign extension to use full 64-bit range
- if x == 0 && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += p.valSize(uint64(x))
- return
-}
-
-// Encode a uint32.
-// Exactly the same as int32, except for no sign extension.
-func (o *Buffer) enc_uint32(p *Properties, base structPointer) error {
- v := structPointer_Word32(base, p.field)
- if word32_IsNil(v) {
- return ErrNil
- }
- x := word32_Get(v)
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, uint64(x))
- return nil
-}
-
-func (o *Buffer) enc_proto3_uint32(p *Properties, base structPointer) error {
- v := structPointer_Word32Val(base, p.field)
- x := word32Val_Get(v)
- if x == 0 {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, uint64(x))
- return nil
-}
-
-func size_uint32(p *Properties, base structPointer) (n int) {
- v := structPointer_Word32(base, p.field)
- if word32_IsNil(v) {
- return 0
- }
- x := word32_Get(v)
- n += len(p.tagcode)
- n += p.valSize(uint64(x))
- return
-}
-
-func size_proto3_uint32(p *Properties, base structPointer) (n int) {
- v := structPointer_Word32Val(base, p.field)
- x := word32Val_Get(v)
- if x == 0 && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += p.valSize(uint64(x))
- return
-}
-
-// Encode an int64.
-func (o *Buffer) enc_int64(p *Properties, base structPointer) error {
- v := structPointer_Word64(base, p.field)
- if word64_IsNil(v) {
- return ErrNil
- }
- x := word64_Get(v)
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, x)
- return nil
-}
-
-func (o *Buffer) enc_proto3_int64(p *Properties, base structPointer) error {
- v := structPointer_Word64Val(base, p.field)
- x := word64Val_Get(v)
- if x == 0 {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, x)
- return nil
-}
-
-func size_int64(p *Properties, base structPointer) (n int) {
- v := structPointer_Word64(base, p.field)
- if word64_IsNil(v) {
- return 0
- }
- x := word64_Get(v)
- n += len(p.tagcode)
- n += p.valSize(x)
- return
-}
-
-func size_proto3_int64(p *Properties, base structPointer) (n int) {
- v := structPointer_Word64Val(base, p.field)
- x := word64Val_Get(v)
- if x == 0 && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += p.valSize(x)
- return
-}
-
-// Encode a string.
-func (o *Buffer) enc_string(p *Properties, base structPointer) error {
- v := *structPointer_String(base, p.field)
- if v == nil {
- return ErrNil
- }
- x := *v
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeStringBytes(x)
- return nil
-}
-
-func (o *Buffer) enc_proto3_string(p *Properties, base structPointer) error {
- v := *structPointer_StringVal(base, p.field)
- if v == "" {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeStringBytes(v)
- return nil
-}
-
-func size_string(p *Properties, base structPointer) (n int) {
- v := *structPointer_String(base, p.field)
- if v == nil {
- return 0
- }
- x := *v
- n += len(p.tagcode)
- n += sizeStringBytes(x)
- return
-}
-
-func size_proto3_string(p *Properties, base structPointer) (n int) {
- v := *structPointer_StringVal(base, p.field)
- if v == "" && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += sizeStringBytes(v)
- return
+ siz := Size(pb)
+ p.EncodeVarint(uint64(siz))
+ return p.Marshal(pb)
}
// All protocol buffer fields are nillable, but be careful.
@@ -538,825 +219,3 @@ func isNil(v reflect.Value) bool {
}
return false
}
-
-// Encode a message struct.
-func (o *Buffer) enc_struct_message(p *Properties, base structPointer) error {
- var state errorState
- structp := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(structp) {
- return ErrNil
- }
-
- // Can the object marshal itself?
- if p.isMarshaler {
- m := structPointer_Interface(structp, p.stype).(Marshaler)
- data, err := m.Marshal()
- if err != nil && !state.shouldContinue(err, nil) {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- return state.err
- }
-
- o.buf = append(o.buf, p.tagcode...)
- return o.enc_len_struct(p.sprop, structp, &state)
-}
-
-func size_struct_message(p *Properties, base structPointer) int {
- structp := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(structp) {
- return 0
- }
-
- // Can the object marshal itself?
- if p.isMarshaler {
- m := structPointer_Interface(structp, p.stype).(Marshaler)
- data, _ := m.Marshal()
- n0 := len(p.tagcode)
- n1 := sizeRawBytes(data)
- return n0 + n1
- }
-
- n0 := len(p.tagcode)
- n1 := size_struct(p.sprop, structp)
- n2 := sizeVarint(uint64(n1)) // size of encoded length
- return n0 + n1 + n2
-}
-
-// Encode a group struct.
-func (o *Buffer) enc_struct_group(p *Properties, base structPointer) error {
- var state errorState
- b := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(b) {
- return ErrNil
- }
-
- o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))
- err := o.enc_struct(p.sprop, b)
- if err != nil && !state.shouldContinue(err, nil) {
- return err
- }
- o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))
- return state.err
-}
-
-func size_struct_group(p *Properties, base structPointer) (n int) {
- b := structPointer_GetStructPointer(base, p.field)
- if structPointer_IsNil(b) {
- return 0
- }
-
- n += sizeVarint(uint64((p.Tag << 3) | WireStartGroup))
- n += size_struct(p.sprop, b)
- n += sizeVarint(uint64((p.Tag << 3) | WireEndGroup))
- return
-}
-
-// Encode a slice of bools ([]bool).
-func (o *Buffer) enc_slice_bool(p *Properties, base structPointer) error {
- s := *structPointer_BoolSlice(base, p.field)
- l := len(s)
- if l == 0 {
- return ErrNil
- }
- for _, x := range s {
- o.buf = append(o.buf, p.tagcode...)
- v := uint64(0)
- if x {
- v = 1
- }
- p.valEnc(o, v)
- }
- return nil
-}
-
-func size_slice_bool(p *Properties, base structPointer) int {
- s := *structPointer_BoolSlice(base, p.field)
- l := len(s)
- if l == 0 {
- return 0
- }
- return l * (len(p.tagcode) + 1) // each bool takes exactly one byte
-}
-
-// Encode a slice of bools ([]bool) in packed format.
-func (o *Buffer) enc_slice_packed_bool(p *Properties, base structPointer) error {
- s := *structPointer_BoolSlice(base, p.field)
- l := len(s)
- if l == 0 {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeVarint(uint64(l)) // each bool takes exactly one byte
- for _, x := range s {
- v := uint64(0)
- if x {
- v = 1
- }
- p.valEnc(o, v)
- }
- return nil
-}
-
-func size_slice_packed_bool(p *Properties, base structPointer) (n int) {
- s := *structPointer_BoolSlice(base, p.field)
- l := len(s)
- if l == 0 {
- return 0
- }
- n += len(p.tagcode)
- n += sizeVarint(uint64(l))
- n += l // each bool takes exactly one byte
- return
-}
-
-// Encode a slice of bytes ([]byte).
-func (o *Buffer) enc_slice_byte(p *Properties, base structPointer) error {
- s := *structPointer_Bytes(base, p.field)
- if s == nil {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(s)
- return nil
-}
-
-func (o *Buffer) enc_proto3_slice_byte(p *Properties, base structPointer) error {
- s := *structPointer_Bytes(base, p.field)
- if len(s) == 0 {
- return ErrNil
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(s)
- return nil
-}
-
-func size_slice_byte(p *Properties, base structPointer) (n int) {
- s := *structPointer_Bytes(base, p.field)
- if s == nil && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += sizeRawBytes(s)
- return
-}
-
-func size_proto3_slice_byte(p *Properties, base structPointer) (n int) {
- s := *structPointer_Bytes(base, p.field)
- if len(s) == 0 && !p.oneof {
- return 0
- }
- n += len(p.tagcode)
- n += sizeRawBytes(s)
- return
-}
-
-// Encode a slice of int32s ([]int32).
-func (o *Buffer) enc_slice_int32(p *Properties, base structPointer) error {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- for i := 0; i < l; i++ {
- o.buf = append(o.buf, p.tagcode...)
- x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
- p.valEnc(o, uint64(x))
- }
- return nil
-}
-
-func size_slice_int32(p *Properties, base structPointer) (n int) {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- for i := 0; i < l; i++ {
- n += len(p.tagcode)
- x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
- n += p.valSize(uint64(x))
- }
- return
-}
-
-// Encode a slice of int32s ([]int32) in packed format.
-func (o *Buffer) enc_slice_packed_int32(p *Properties, base structPointer) error {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- // TODO: Reuse a Buffer.
- buf := NewBuffer(nil)
- for i := 0; i < l; i++ {
- x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
- p.valEnc(buf, uint64(x))
- }
-
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeVarint(uint64(len(buf.buf)))
- o.buf = append(o.buf, buf.buf...)
- return nil
-}
-
-func size_slice_packed_int32(p *Properties, base structPointer) (n int) {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- var bufSize int
- for i := 0; i < l; i++ {
- x := int32(s.Index(i)) // permit sign extension to use full 64-bit range
- bufSize += p.valSize(uint64(x))
- }
-
- n += len(p.tagcode)
- n += sizeVarint(uint64(bufSize))
- n += bufSize
- return
-}
-
-// Encode a slice of uint32s ([]uint32).
-// Exactly the same as int32, except for no sign extension.
-func (o *Buffer) enc_slice_uint32(p *Properties, base structPointer) error {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- for i := 0; i < l; i++ {
- o.buf = append(o.buf, p.tagcode...)
- x := s.Index(i)
- p.valEnc(o, uint64(x))
- }
- return nil
-}
-
-func size_slice_uint32(p *Properties, base structPointer) (n int) {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- for i := 0; i < l; i++ {
- n += len(p.tagcode)
- x := s.Index(i)
- n += p.valSize(uint64(x))
- }
- return
-}
-
-// Encode a slice of uint32s ([]uint32) in packed format.
-// Exactly the same as int32, except for no sign extension.
-func (o *Buffer) enc_slice_packed_uint32(p *Properties, base structPointer) error {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- // TODO: Reuse a Buffer.
- buf := NewBuffer(nil)
- for i := 0; i < l; i++ {
- p.valEnc(buf, uint64(s.Index(i)))
- }
-
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeVarint(uint64(len(buf.buf)))
- o.buf = append(o.buf, buf.buf...)
- return nil
-}
-
-func size_slice_packed_uint32(p *Properties, base structPointer) (n int) {
- s := structPointer_Word32Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- var bufSize int
- for i := 0; i < l; i++ {
- bufSize += p.valSize(uint64(s.Index(i)))
- }
-
- n += len(p.tagcode)
- n += sizeVarint(uint64(bufSize))
- n += bufSize
- return
-}
-
-// Encode a slice of int64s ([]int64).
-func (o *Buffer) enc_slice_int64(p *Properties, base structPointer) error {
- s := structPointer_Word64Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- for i := 0; i < l; i++ {
- o.buf = append(o.buf, p.tagcode...)
- p.valEnc(o, s.Index(i))
- }
- return nil
-}
-
-func size_slice_int64(p *Properties, base structPointer) (n int) {
- s := structPointer_Word64Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- for i := 0; i < l; i++ {
- n += len(p.tagcode)
- n += p.valSize(s.Index(i))
- }
- return
-}
-
-// Encode a slice of int64s ([]int64) in packed format.
-func (o *Buffer) enc_slice_packed_int64(p *Properties, base structPointer) error {
- s := structPointer_Word64Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return ErrNil
- }
- // TODO: Reuse a Buffer.
- buf := NewBuffer(nil)
- for i := 0; i < l; i++ {
- p.valEnc(buf, s.Index(i))
- }
-
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeVarint(uint64(len(buf.buf)))
- o.buf = append(o.buf, buf.buf...)
- return nil
-}
-
-func size_slice_packed_int64(p *Properties, base structPointer) (n int) {
- s := structPointer_Word64Slice(base, p.field)
- l := s.Len()
- if l == 0 {
- return 0
- }
- var bufSize int
- for i := 0; i < l; i++ {
- bufSize += p.valSize(s.Index(i))
- }
-
- n += len(p.tagcode)
- n += sizeVarint(uint64(bufSize))
- n += bufSize
- return
-}
-
-// Encode a slice of slice of bytes ([][]byte).
-func (o *Buffer) enc_slice_slice_byte(p *Properties, base structPointer) error {
- ss := *structPointer_BytesSlice(base, p.field)
- l := len(ss)
- if l == 0 {
- return ErrNil
- }
- for i := 0; i < l; i++ {
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(ss[i])
- }
- return nil
-}
-
-func size_slice_slice_byte(p *Properties, base structPointer) (n int) {
- ss := *structPointer_BytesSlice(base, p.field)
- l := len(ss)
- if l == 0 {
- return 0
- }
- n += l * len(p.tagcode)
- for i := 0; i < l; i++ {
- n += sizeRawBytes(ss[i])
- }
- return
-}
-
-// Encode a slice of strings ([]string).
-func (o *Buffer) enc_slice_string(p *Properties, base structPointer) error {
- ss := *structPointer_StringSlice(base, p.field)
- l := len(ss)
- for i := 0; i < l; i++ {
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeStringBytes(ss[i])
- }
- return nil
-}
-
-func size_slice_string(p *Properties, base structPointer) (n int) {
- ss := *structPointer_StringSlice(base, p.field)
- l := len(ss)
- n += l * len(p.tagcode)
- for i := 0; i < l; i++ {
- n += sizeStringBytes(ss[i])
- }
- return
-}
-
-// Encode a slice of message structs ([]*struct).
-func (o *Buffer) enc_slice_struct_message(p *Properties, base structPointer) error {
- var state errorState
- s := structPointer_StructPointerSlice(base, p.field)
- l := s.Len()
-
- for i := 0; i < l; i++ {
- structp := s.Index(i)
- if structPointer_IsNil(structp) {
- return errRepeatedHasNil
- }
-
- // Can the object marshal itself?
- if p.isMarshaler {
- m := structPointer_Interface(structp, p.stype).(Marshaler)
- data, err := m.Marshal()
- if err != nil && !state.shouldContinue(err, nil) {
- return err
- }
- o.buf = append(o.buf, p.tagcode...)
- o.EncodeRawBytes(data)
- continue
- }
-
- o.buf = append(o.buf, p.tagcode...)
- err := o.enc_len_struct(p.sprop, structp, &state)
- if err != nil && !state.shouldContinue(err, nil) {
- if err == ErrNil {
- return errRepeatedHasNil
- }
- return err
- }
- }
- return state.err
-}
-
-func size_slice_struct_message(p *Properties, base structPointer) (n int) {
- s := structPointer_StructPointerSlice(base, p.field)
- l := s.Len()
- n += l * len(p.tagcode)
- for i := 0; i < l; i++ {
- structp := s.Index(i)
- if structPointer_IsNil(structp) {
- return // return the size up to this point
- }
-
- // Can the object marshal itself?
- if p.isMarshaler {
- m := structPointer_Interface(structp, p.stype).(Marshaler)
- data, _ := m.Marshal()
- n += sizeRawBytes(data)
- continue
- }
-
- n0 := size_struct(p.sprop, structp)
- n1 := sizeVarint(uint64(n0)) // size of encoded length
- n += n0 + n1
- }
- return
-}
-
-// Encode a slice of group structs ([]*struct).
-func (o *Buffer) enc_slice_struct_group(p *Properties, base structPointer) error {
- var state errorState
- s := structPointer_StructPointerSlice(base, p.field)
- l := s.Len()
-
- for i := 0; i < l; i++ {
- b := s.Index(i)
- if structPointer_IsNil(b) {
- return errRepeatedHasNil
- }
-
- o.EncodeVarint(uint64((p.Tag << 3) | WireStartGroup))
-
- err := o.enc_struct(p.sprop, b)
-
- if err != nil && !state.shouldContinue(err, nil) {
- if err == ErrNil {
- return errRepeatedHasNil
- }
- return err
- }
-
- o.EncodeVarint(uint64((p.Tag << 3) | WireEndGroup))
- }
- return state.err
-}
-
-func size_slice_struct_group(p *Properties, base structPointer) (n int) {
- s := structPointer_StructPointerSlice(base, p.field)
- l := s.Len()
-
- n += l * sizeVarint(uint64((p.Tag<<3)|WireStartGroup))
- n += l * sizeVarint(uint64((p.Tag<<3)|WireEndGroup))
- for i := 0; i < l; i++ {
- b := s.Index(i)
- if structPointer_IsNil(b) {
- return // return size up to this point
- }
-
- n += size_struct(p.sprop, b)
- }
- return
-}
-
-// Encode an extension map.
-func (o *Buffer) enc_map(p *Properties, base structPointer) error {
- exts := structPointer_ExtMap(base, p.field)
- if err := encodeExtensionsMap(*exts); err != nil {
- return err
- }
-
- return o.enc_map_body(*exts)
-}
-
-func (o *Buffer) enc_exts(p *Properties, base structPointer) error {
- exts := structPointer_Extensions(base, p.field)
-
- v, mu := exts.extensionsRead()
- if v == nil {
- return nil
- }
-
- mu.Lock()
- defer mu.Unlock()
- if err := encodeExtensionsMap(v); err != nil {
- return err
- }
-
- return o.enc_map_body(v)
-}
-
-func (o *Buffer) enc_map_body(v map[int32]Extension) error {
- // Fast-path for common cases: zero or one extensions.
- if len(v) <= 1 {
- for _, e := range v {
- o.buf = append(o.buf, e.enc...)
- }
- return nil
- }
-
- // Sort keys to provide a deterministic encoding.
- keys := make([]int, 0, len(v))
- for k := range v {
- keys = append(keys, int(k))
- }
- sort.Ints(keys)
-
- for _, k := range keys {
- o.buf = append(o.buf, v[int32(k)].enc...)
- }
- return nil
-}
-
-func size_map(p *Properties, base structPointer) int {
- v := structPointer_ExtMap(base, p.field)
- return extensionsMapSize(*v)
-}
-
-func size_exts(p *Properties, base structPointer) int {
- v := structPointer_Extensions(base, p.field)
- return extensionsSize(v)
-}
-
-// Encode a map field.
-func (o *Buffer) enc_new_map(p *Properties, base structPointer) error {
- var state errorState // XXX: or do we need to plumb this through?
-
- /*
- A map defined as
- map<key_type, value_type> map_field = N;
- is encoded in the same way as
- message MapFieldEntry {
- key_type key = 1;
- value_type value = 2;
- }
- repeated MapFieldEntry map_field = N;
- */
-
- v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V
- if v.Len() == 0 {
- return nil
- }
-
- keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)
-
- enc := func() error {
- if err := p.mkeyprop.enc(o, p.mkeyprop, keybase); err != nil {
- return err
- }
- if err := p.mvalprop.enc(o, p.mvalprop, valbase); err != nil && err != ErrNil {
- return err
- }
- return nil
- }
-
- // Don't sort map keys. It is not required by the spec, and C++ doesn't do it.
- for _, key := range v.MapKeys() {
- val := v.MapIndex(key)
-
- keycopy.Set(key)
- valcopy.Set(val)
-
- o.buf = append(o.buf, p.tagcode...)
- if err := o.enc_len_thing(enc, &state); err != nil {
- return err
- }
- }
- return nil
-}
-
-func size_new_map(p *Properties, base structPointer) int {
- v := structPointer_NewAt(base, p.field, p.mtype).Elem() // map[K]V
-
- keycopy, valcopy, keybase, valbase := mapEncodeScratch(p.mtype)
-
- n := 0
- for _, key := range v.MapKeys() {
- val := v.MapIndex(key)
- keycopy.Set(key)
- valcopy.Set(val)
-
- // Tag codes for key and val are the responsibility of the sub-sizer.
- keysize := p.mkeyprop.size(p.mkeyprop, keybase)
- valsize := p.mvalprop.size(p.mvalprop, valbase)
- entry := keysize + valsize
- // Add on tag code and length of map entry itself.
- n += len(p.tagcode) + sizeVarint(uint64(entry)) + entry
- }
- return n
-}
-
-// mapEncodeScratch returns a new reflect.Value matching the map's value type,
-// and a structPointer suitable for passing to an encoder or sizer.
-func mapEncodeScratch(mapType reflect.Type) (keycopy, valcopy reflect.Value, keybase, valbase structPointer) {
- // Prepare addressable doubly-indirect placeholders for the key and value types.
- // This is needed because the element-type encoders expect **T, but the map iteration produces T.
-
- keycopy = reflect.New(mapType.Key()).Elem() // addressable K
- keyptr := reflect.New(reflect.PtrTo(keycopy.Type())).Elem() // addressable *K
- keyptr.Set(keycopy.Addr()) //
- keybase = toStructPointer(keyptr.Addr()) // **K
-
- // Value types are more varied and require special handling.
- switch mapType.Elem().Kind() {
- case reflect.Slice:
- // []byte
- var dummy []byte
- valcopy = reflect.ValueOf(&dummy).Elem() // addressable []byte
- valbase = toStructPointer(valcopy.Addr())
- case reflect.Ptr:
- // message; the generated field type is map[K]*Msg (so V is *Msg),
- // so we only need one level of indirection.
- valcopy = reflect.New(mapType.Elem()).Elem() // addressable V
- valbase = toStructPointer(valcopy.Addr())
- default:
- // everything else
- valcopy = reflect.New(mapType.Elem()).Elem() // addressable V
- valptr := reflect.New(reflect.PtrTo(valcopy.Type())).Elem() // addressable *V
- valptr.Set(valcopy.Addr()) //
- valbase = toStructPointer(valptr.Addr()) // **V
- }
- return
-}
-
-// Encode a struct.
-func (o *Buffer) enc_struct(prop *StructProperties, base structPointer) error {
- var state errorState
- // Encode fields in tag order so that decoders may use optimizations
- // that depend on the ordering.
- // https://developers.google.com/protocol-buffers/docs/encoding#order
- for _, i := range prop.order {
- p := prop.Prop[i]
- if p.enc != nil {
- err := p.enc(o, p, base)
- if err != nil {
- if err == ErrNil {
- if p.Required && state.err == nil {
- state.err = &RequiredNotSetError{p.Name}
- }
- } else if err == errRepeatedHasNil {
- // Give more context to nil values in repeated fields.
- return errors.New("repeated field " + p.OrigName + " has nil element")
- } else if !state.shouldContinue(err, p) {
- return err
- }
- }
- if len(o.buf) > maxMarshalSize {
- return ErrTooLarge
- }
- }
- }
-
- // Do oneof fields.
- if prop.oneofMarshaler != nil {
- m := structPointer_Interface(base, prop.stype).(Message)
- if err := prop.oneofMarshaler(m, o); err == ErrNil {
- return errOneofHasNil
- } else if err != nil {
- return err
- }
- }
-
- // Add unrecognized fields at the end.
- if prop.unrecField.IsValid() {
- v := *structPointer_Bytes(base, prop.unrecField)
- if len(o.buf)+len(v) > maxMarshalSize {
- return ErrTooLarge
- }
- if len(v) > 0 {
- o.buf = append(o.buf, v...)
- }
- }
-
- return state.err
-}
-
-func size_struct(prop *StructProperties, base structPointer) (n int) {
- for _, i := range prop.order {
- p := prop.Prop[i]
- if p.size != nil {
- n += p.size(p, base)
- }
- }
-
- // Add unrecognized fields at the end.
- if prop.unrecField.IsValid() {
- v := *structPointer_Bytes(base, prop.unrecField)
- n += len(v)
- }
-
- // Factor in any oneof fields.
- if prop.oneofSizer != nil {
- m := structPointer_Interface(base, prop.stype).(Message)
- n += prop.oneofSizer(m)
- }
-
- return
-}
-
-var zeroes [20]byte // longer than any conceivable sizeVarint
-
-// Encode a struct, preceded by its encoded length (as a varint).
-func (o *Buffer) enc_len_struct(prop *StructProperties, base structPointer, state *errorState) error {
- return o.enc_len_thing(func() error { return o.enc_struct(prop, base) }, state)
-}
-
-// Encode something, preceded by its encoded length (as a varint).
-func (o *Buffer) enc_len_thing(enc func() error, state *errorState) error {
- iLen := len(o.buf)
- o.buf = append(o.buf, 0, 0, 0, 0) // reserve four bytes for length
- iMsg := len(o.buf)
- err := enc()
- if err != nil && !state.shouldContinue(err, nil) {
- return err
- }
- lMsg := len(o.buf) - iMsg
- lLen := sizeVarint(uint64(lMsg))
- switch x := lLen - (iMsg - iLen); {
- case x > 0: // actual length is x bytes larger than the space we reserved
- // Move msg x bytes right.
- o.buf = append(o.buf, zeroes[:x]...)
- copy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg])
- case x < 0: // actual length is x bytes smaller than the space we reserved
- // Move msg x bytes left.
- copy(o.buf[iMsg+x:], o.buf[iMsg:iMsg+lMsg])
- o.buf = o.buf[:len(o.buf)+x] // x is negative
- }
- // Encode the length in the reserved space.
- o.buf = o.buf[:iLen]
- o.EncodeVarint(uint64(lMsg))
- o.buf = o.buf[:len(o.buf)+lMsg]
- return state.err
-}
-
-// errorState maintains the first error that occurs and updates that error
-// with additional context.
-type errorState struct {
- err error
-}
-
-// shouldContinue reports whether encoding should continue upon encountering the
-// given error. If the error is RequiredNotSetError, shouldContinue returns true
-// and, if this is the first appearance of that error, remembers it for future
-// reporting.
-//
-// If prop is not nil, it may update any error with additional context about the
-// field with the error.
-func (s *errorState) shouldContinue(err error, prop *Properties) bool {
- // Ignore unset required fields.
- reqNotSet, ok := err.(*RequiredNotSetError)
- if !ok {
- return false
- }
- if s.err == nil {
- if prop != nil {
- err = &RequiredNotSetError{prop.Name + "." + reqNotSet.field}
- }
- s.err = err
- }
- return true
-}
diff --git a/vendor/github.com/golang/protobuf/proto/equal.go b/vendor/github.com/golang/protobuf/proto/equal.go
index 2ed1cf596..d4db5a1c1 100644
--- a/vendor/github.com/golang/protobuf/proto/equal.go
+++ b/vendor/github.com/golang/protobuf/proto/equal.go
@@ -109,15 +109,6 @@ func equalStruct(v1, v2 reflect.Value) bool {
// set/unset mismatch
return false
}
- b1, ok := f1.Interface().(raw)
- if ok {
- b2 := f2.Interface().(raw)
- // RawMessage
- if !bytes.Equal(b1.Bytes(), b2.Bytes()) {
- return false
- }
- continue
- }
f1, f2 = f1.Elem(), f2.Elem()
}
if !equalAny(f1, f2, sprop.Prop[i]) {
@@ -146,11 +137,7 @@ func equalStruct(v1, v2 reflect.Value) bool {
u1 := uf.Bytes()
u2 := v2.FieldByName("XXX_unrecognized").Bytes()
- if !bytes.Equal(u1, u2) {
- return false
- }
-
- return true
+ return bytes.Equal(u1, u2)
}
// v1 and v2 are known to have the same type.
@@ -261,6 +248,15 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
m1, m2 := e1.value, e2.value
+ if m1 == nil && m2 == nil {
+ // Both have only encoded form.
+ if bytes.Equal(e1.enc, e2.enc) {
+ continue
+ }
+ // The bytes are different, but the extensions might still be
+ // equal. We need to decode them to compare.
+ }
+
if m1 != nil && m2 != nil {
// Both are unencoded.
if !equalAny(reflect.ValueOf(m1), reflect.ValueOf(m2), nil) {
@@ -276,8 +272,12 @@ func equalExtMap(base reflect.Type, em1, em2 map[int32]Extension) bool {
desc = m[extNum]
}
if desc == nil {
+ // If both have only encoded form and the bytes are the same,
+ // it is handled above. We get here when the bytes are different.
+ // We don't know how to decode it, so just compare them as byte
+ // slices.
log.Printf("proto: don't know how to compare extension %d of %v", extNum, base)
- continue
+ return false
}
var err error
if m1 == nil {
diff --git a/vendor/github.com/golang/protobuf/proto/extensions.go b/vendor/github.com/golang/protobuf/proto/extensions.go
index eaad21831..816a3b9d6 100644
--- a/vendor/github.com/golang/protobuf/proto/extensions.go
+++ b/vendor/github.com/golang/protobuf/proto/extensions.go
@@ -38,6 +38,7 @@ package proto
import (
"errors"
"fmt"
+ "io"
"reflect"
"strconv"
"sync"
@@ -91,14 +92,29 @@ func (n notLocker) Unlock() {}
// extendable returns the extendableProto interface for the given generated proto message.
// If the proto message has the old extension format, it returns a wrapper that implements
// the extendableProto interface.
-func extendable(p interface{}) (extendableProto, bool) {
- if ep, ok := p.(extendableProto); ok {
- return ep, ok
- }
- if ep, ok := p.(extendableProtoV1); ok {
- return extensionAdapter{ep}, ok
+func extendable(p interface{}) (extendableProto, error) {
+ switch p := p.(type) {
+ case extendableProto:
+ if isNilPtr(p) {
+ return nil, fmt.Errorf("proto: nil %T is not extendable", p)
+ }
+ return p, nil
+ case extendableProtoV1:
+ if isNilPtr(p) {
+ return nil, fmt.Errorf("proto: nil %T is not extendable", p)
+ }
+ return extensionAdapter{p}, nil
}
- return nil, false
+ // Don't allocate a specific error containing %T:
+ // this is the hot path for Clone and MarshalText.
+ return nil, errNotExtendable
+}
+
+var errNotExtendable = errors.New("proto: not an extendable proto.Message")
+
+func isNilPtr(x interface{}) bool {
+ v := reflect.ValueOf(x)
+ return v.Kind() == reflect.Ptr && v.IsNil()
}
// XXX_InternalExtensions is an internal representation of proto extensions.
@@ -143,9 +159,6 @@ func (e *XXX_InternalExtensions) extensionsRead() (map[int32]Extension, sync.Loc
return e.p.extensionMap, &e.p.mu
}
-var extendableProtoType = reflect.TypeOf((*extendableProto)(nil)).Elem()
-var extendableProtoV1Type = reflect.TypeOf((*extendableProtoV1)(nil)).Elem()
-
// ExtensionDesc represents an extension specification.
// Used in generated code from the protocol compiler.
type ExtensionDesc struct {
@@ -179,8 +192,8 @@ type Extension struct {
// SetRawExtension is for testing only.
func SetRawExtension(base Message, id int32, b []byte) {
- epb, ok := extendable(base)
- if !ok {
+ epb, err := extendable(base)
+ if err != nil {
return
}
extmap := epb.extensionsWrite()
@@ -205,7 +218,7 @@ func checkExtensionTypes(pb extendableProto, extension *ExtensionDesc) error {
pbi = ea.extendableProtoV1
}
if a, b := reflect.TypeOf(pbi), reflect.TypeOf(extension.ExtendedType); a != b {
- return errors.New("proto: bad extended type; " + b.String() + " does not extend " + a.String())
+ return fmt.Errorf("proto: bad extended type; %v does not extend %v", b, a)
}
// Check the range.
if !isExtensionField(pb, extension.Field) {
@@ -250,85 +263,11 @@ func extensionProperties(ed *ExtensionDesc) *Properties {
return prop
}
-// encode encodes any unmarshaled (unencoded) extensions in e.
-func encodeExtensions(e *XXX_InternalExtensions) error {
- m, mu := e.extensionsRead()
- if m == nil {
- return nil // fast path
- }
- mu.Lock()
- defer mu.Unlock()
- return encodeExtensionsMap(m)
-}
-
-// encode encodes any unmarshaled (unencoded) extensions in e.
-func encodeExtensionsMap(m map[int32]Extension) error {
- for k, e := range m {
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- et := reflect.TypeOf(e.desc.ExtensionType)
- props := extensionProperties(e.desc)
-
- p := NewBuffer(nil)
- // If e.value has type T, the encoder expects a *struct{ X T }.
- // Pass a *T with a zero field and hope it all works out.
- x := reflect.New(et)
- x.Elem().Set(reflect.ValueOf(e.value))
- if err := props.enc(p, props, toStructPointer(x)); err != nil {
- return err
- }
- e.enc = p.buf
- m[k] = e
- }
- return nil
-}
-
-func extensionsSize(e *XXX_InternalExtensions) (n int) {
- m, mu := e.extensionsRead()
- if m == nil {
- return 0
- }
- mu.Lock()
- defer mu.Unlock()
- return extensionsMapSize(m)
-}
-
-func extensionsMapSize(m map[int32]Extension) (n int) {
- for _, e := range m {
- if e.value == nil || e.desc == nil {
- // Extension is only in its encoded form.
- n += len(e.enc)
- continue
- }
-
- // We don't skip extensions that have an encoded form set,
- // because the extension value may have been mutated after
- // the last time this function was called.
-
- et := reflect.TypeOf(e.desc.ExtensionType)
- props := extensionProperties(e.desc)
-
- // If e.value has type T, the encoder expects a *struct{ X T }.
- // Pass a *T with a zero field and hope it all works out.
- x := reflect.New(et)
- x.Elem().Set(reflect.ValueOf(e.value))
- n += props.size(props, toStructPointer(x))
- }
- return
-}
-
// HasExtension returns whether the given extension is present in pb.
func HasExtension(pb Message, extension *ExtensionDesc) bool {
// TODO: Check types, field numbers, etc.?
- epb, ok := extendable(pb)
- if !ok {
+ epb, err := extendable(pb)
+ if err != nil {
return false
}
extmap, mu := epb.extensionsRead()
@@ -336,15 +275,15 @@ func HasExtension(pb Message, extension *ExtensionDesc) bool {
return false
}
mu.Lock()
- _, ok = extmap[extension.Field]
+ _, ok := extmap[extension.Field]
mu.Unlock()
return ok
}
// ClearExtension removes the given extension from pb.
func ClearExtension(pb Message, extension *ExtensionDesc) {
- epb, ok := extendable(pb)
- if !ok {
+ epb, err := extendable(pb)
+ if err != nil {
return
}
// TODO: Check types, field numbers, etc.?
@@ -352,16 +291,26 @@ func ClearExtension(pb Message, extension *ExtensionDesc) {
delete(extmap, extension.Field)
}
-// GetExtension parses and returns the given extension of pb.
-// If the extension is not present and has no default value it returns ErrMissingExtension.
+// GetExtension retrieves a proto2 extended field from pb.
+//
+// If the descriptor is type complete (i.e., ExtensionDesc.ExtensionType is non-nil),
+// then GetExtension parses the encoded field and returns a Go value of the specified type.
+// If the field is not present, then the default value is returned (if one is specified),
+// otherwise ErrMissingExtension is reported.
+//
+// If the descriptor is not type complete (i.e., ExtensionDesc.ExtensionType is nil),
+// then GetExtension returns the raw encoded bytes of the field extension.
func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
- epb, ok := extendable(pb)
- if !ok {
- return nil, errors.New("proto: not an extendable proto")
+ epb, err := extendable(pb)
+ if err != nil {
+ return nil, err
}
- if err := checkExtensionTypes(epb, extension); err != nil {
- return nil, err
+ if extension.ExtendedType != nil {
+ // can only check type if this is a complete descriptor
+ if err := checkExtensionTypes(epb, extension); err != nil {
+ return nil, err
+ }
}
emap, mu := epb.extensionsRead()
@@ -388,6 +337,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
return e.value, nil
}
+ if extension.ExtensionType == nil {
+ // incomplete descriptor
+ return e.enc, nil
+ }
+
v, err := decodeExtension(e.enc, extension)
if err != nil {
return nil, err
@@ -405,6 +359,11 @@ func GetExtension(pb Message, extension *ExtensionDesc) (interface{}, error) {
// defaultExtensionValue returns the default value for extension.
// If no default for an extension is defined ErrMissingExtension is returned.
func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
+ if extension.ExtensionType == nil {
+ // incomplete descriptor, so no default
+ return nil, ErrMissingExtension
+ }
+
t := reflect.TypeOf(extension.ExtensionType)
props := extensionProperties(extension)
@@ -439,31 +398,28 @@ func defaultExtensionValue(extension *ExtensionDesc) (interface{}, error) {
// decodeExtension decodes an extension encoded in b.
func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
- o := NewBuffer(b)
-
t := reflect.TypeOf(extension.ExtensionType)
-
- props := extensionProperties(extension)
+ unmarshal := typeUnmarshaler(t, extension.Tag)
// t is a pointer to a struct, pointer to basic type or a slice.
- // Allocate a "field" to store the pointer/slice itself; the
- // pointer/slice will be stored here. We pass
- // the address of this field to props.dec.
- // This passes a zero field and a *t and lets props.dec
- // interpret it as a *struct{ x t }.
+ // Allocate space to store the pointer/slice.
value := reflect.New(t).Elem()
+ var err error
for {
- // Discard wire type and field number varint. It isn't needed.
- if _, err := o.DecodeVarint(); err != nil {
- return nil, err
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
}
+ b = b[n:]
+ wire := int(x) & 7
- if err := props.dec(o, props, toStructPointer(value.Addr())); err != nil {
+ b, err = unmarshal(b, valToPointer(value.Addr()), wire)
+ if err != nil {
return nil, err
}
- if o.index >= len(o.buf) {
+ if len(b) == 0 {
break
}
}
@@ -473,9 +429,9 @@ func decodeExtension(b []byte, extension *ExtensionDesc) (interface{}, error) {
// GetExtensions returns a slice of the extensions present in pb that are also listed in es.
// The returned slice has the same length as es; missing extensions will appear as nil elements.
func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, err error) {
- epb, ok := extendable(pb)
- if !ok {
- return nil, errors.New("proto: not an extendable proto")
+ epb, err := extendable(pb)
+ if err != nil {
+ return nil, err
}
extensions = make([]interface{}, len(es))
for i, e := range es {
@@ -494,9 +450,9 @@ func GetExtensions(pb Message, es []*ExtensionDesc) (extensions []interface{}, e
// For non-registered extensions, ExtensionDescs returns an incomplete descriptor containing
// just the Field field, which defines the extension's field number.
func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
- epb, ok := extendable(pb)
- if !ok {
- return nil, fmt.Errorf("proto: %T is not an extendable proto.Message", pb)
+ epb, err := extendable(pb)
+ if err != nil {
+ return nil, err
}
registeredExtensions := RegisteredExtensions(pb)
@@ -523,9 +479,9 @@ func ExtensionDescs(pb Message) ([]*ExtensionDesc, error) {
// SetExtension sets the specified extension of pb to the specified value.
func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error {
- epb, ok := extendable(pb)
- if !ok {
- return errors.New("proto: not an extendable proto")
+ epb, err := extendable(pb)
+ if err != nil {
+ return err
}
if err := checkExtensionTypes(epb, extension); err != nil {
return err
@@ -550,8 +506,8 @@ func SetExtension(pb Message, extension *ExtensionDesc, value interface{}) error
// ClearAllExtensions clears all extensions from pb.
func ClearAllExtensions(pb Message) {
- epb, ok := extendable(pb)
- if !ok {
+ epb, err := extendable(pb)
+ if err != nil {
return
}
m := epb.extensionsWrite()
diff --git a/vendor/github.com/golang/protobuf/proto/lib.go b/vendor/github.com/golang/protobuf/proto/lib.go
index 1c225504a..0e2191b8a 100644
--- a/vendor/github.com/golang/protobuf/proto/lib.go
+++ b/vendor/github.com/golang/protobuf/proto/lib.go
@@ -265,6 +265,7 @@ package proto
import (
"encoding/json"
+ "errors"
"fmt"
"log"
"reflect"
@@ -273,6 +274,8 @@ import (
"sync"
)
+var errInvalidUTF8 = errors.New("proto: invalid UTF-8 string")
+
// Message is implemented by generated protocol buffer messages.
type Message interface {
Reset()
@@ -309,16 +312,7 @@ type Buffer struct {
buf []byte // encode/decode byte stream
index int // read point
- // pools of basic types to amortize allocation.
- bools []bool
- uint32s []uint32
- uint64s []uint64
-
- // extra pools, only used with pointer_reflect.go
- int32s []int32
- int64s []int64
- float32s []float32
- float64s []float64
+ deterministic bool
}
// NewBuffer allocates a new Buffer and initializes its internal data to
@@ -343,6 +337,30 @@ func (p *Buffer) SetBuf(s []byte) {
// Bytes returns the contents of the Buffer.
func (p *Buffer) Bytes() []byte { return p.buf }
+// SetDeterministic sets whether to use deterministic serialization.
+//
+// Deterministic serialization guarantees that for a given binary, equal
+// messages will always be serialized to the same bytes. This implies:
+//
+// - Repeated serialization of a message will return the same bytes.
+// - Different processes of the same binary (which may be executing on
+// different machines) will serialize equal messages to the same bytes.
+//
+// Note that the deterministic serialization is NOT canonical across
+// languages. It is not guaranteed to remain stable over time. It is unstable
+// across different builds with schema changes due to unknown fields.
+// Users who need canonical serialization (e.g., persistent storage in a
+// canonical form, fingerprinting, etc.) should define their own
+// canonicalization specification and implement their own serializer rather
+// than relying on this API.
+//
+// If deterministic serialization is requested, map entries will be sorted
+// by keys in lexographical order. This is an implementation detail and
+// subject to change.
+func (p *Buffer) SetDeterministic(deterministic bool) {
+ p.deterministic = deterministic
+}
+
/*
* Helper routines for simplifying the creation of optional fields of basic type.
*/
@@ -831,22 +849,12 @@ func fieldDefault(ft reflect.Type, prop *Properties) (sf *scalarField, nestedMes
return sf, false, nil
}
+// mapKeys returns a sort.Interface to be used for sorting the map keys.
// Map fields may have key types of non-float scalars, strings and enums.
-// The easiest way to sort them in some deterministic order is to use fmt.
-// If this turns out to be inefficient we can always consider other options,
-// such as doing a Schwartzian transform.
-
func mapKeys(vs []reflect.Value) sort.Interface {
- s := mapKeySorter{
- vs: vs,
- // default Less function: textual comparison
- less: func(a, b reflect.Value) bool {
- return fmt.Sprint(a.Interface()) < fmt.Sprint(b.Interface())
- },
- }
+ s := mapKeySorter{vs: vs}
- // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps;
- // numeric keys are sorted numerically.
+ // Type specialization per https://developers.google.com/protocol-buffers/docs/proto#maps.
if len(vs) == 0 {
return s
}
@@ -855,6 +863,12 @@ func mapKeys(vs []reflect.Value) sort.Interface {
s.less = func(a, b reflect.Value) bool { return a.Int() < b.Int() }
case reflect.Uint32, reflect.Uint64:
s.less = func(a, b reflect.Value) bool { return a.Uint() < b.Uint() }
+ case reflect.Bool:
+ s.less = func(a, b reflect.Value) bool { return !a.Bool() && b.Bool() } // false < true
+ case reflect.String:
+ s.less = func(a, b reflect.Value) bool { return a.String() < b.String() }
+ default:
+ panic(fmt.Sprintf("unsupported map key type: %v", vs[0].Kind()))
}
return s
@@ -895,3 +909,13 @@ const ProtoPackageIsVersion2 = true
// ProtoPackageIsVersion1 is referenced from generated protocol buffer files
// to assert that that code is compatible with this version of the proto package.
const ProtoPackageIsVersion1 = true
+
+// InternalMessageInfo is a type used internally by generated .pb.go files.
+// This type is not intended to be used by non-generated code.
+// This type is not subject to any compatibility guarantee.
+type InternalMessageInfo struct {
+ marshal *marshalInfo
+ unmarshal *unmarshalInfo
+ merge *mergeInfo
+ discard *discardInfo
+}
diff --git a/vendor/github.com/golang/protobuf/proto/message_set.go b/vendor/github.com/golang/protobuf/proto/message_set.go
index fd982decd..3b6ca41d5 100644
--- a/vendor/github.com/golang/protobuf/proto/message_set.go
+++ b/vendor/github.com/golang/protobuf/proto/message_set.go
@@ -42,6 +42,7 @@ import (
"fmt"
"reflect"
"sort"
+ "sync"
)
// errNoMessageTypeID occurs when a protocol buffer does not have a message type ID.
@@ -94,10 +95,7 @@ func (ms *messageSet) find(pb Message) *_MessageSet_Item {
}
func (ms *messageSet) Has(pb Message) bool {
- if ms.find(pb) != nil {
- return true
- }
- return false
+ return ms.find(pb) != nil
}
func (ms *messageSet) Unmarshal(pb Message) error {
@@ -150,46 +148,42 @@ func skipVarint(buf []byte) []byte {
// MarshalMessageSet encodes the extension map represented by m in the message set wire format.
// It is called by generated Marshal methods on protocol buffer messages with the message_set_wire_format option.
func MarshalMessageSet(exts interface{}) ([]byte, error) {
- var m map[int32]Extension
+ return marshalMessageSet(exts, false)
+}
+
+// marshaMessageSet implements above function, with the opt to turn on / off deterministic during Marshal.
+func marshalMessageSet(exts interface{}, deterministic bool) ([]byte, error) {
switch exts := exts.(type) {
case *XXX_InternalExtensions:
- if err := encodeExtensions(exts); err != nil {
- return nil, err
- }
- m, _ = exts.extensionsRead()
+ var u marshalInfo
+ siz := u.sizeMessageSet(exts)
+ b := make([]byte, 0, siz)
+ return u.appendMessageSet(b, exts, deterministic)
+
case map[int32]Extension:
- if err := encodeExtensionsMap(exts); err != nil {
- return nil, err
+ // This is an old-style extension map.
+ // Wrap it in a new-style XXX_InternalExtensions.
+ ie := XXX_InternalExtensions{
+ p: &struct {
+ mu sync.Mutex
+ extensionMap map[int32]Extension
+ }{
+ extensionMap: exts,
+ },
}
- m = exts
+
+ var u marshalInfo
+ siz := u.sizeMessageSet(&ie)
+ b := make([]byte, 0, siz)
+ return u.appendMessageSet(b, &ie, deterministic)
+
default:
return nil, errors.New("proto: not an extension map")
}
-
- // Sort extension IDs to provide a deterministic encoding.
- // See also enc_map in encode.go.
- ids := make([]int, 0, len(m))
- for id := range m {
- ids = append(ids, int(id))
- }
- sort.Ints(ids)
-
- ms := &messageSet{Item: make([]*_MessageSet_Item, 0, len(m))}
- for _, id := range ids {
- e := m[int32(id)]
- // Remove the wire type and field number varint, as well as the length varint.
- msg := skipVarint(skipVarint(e.enc))
-
- ms.Item = append(ms.Item, &_MessageSet_Item{
- TypeId: Int32(int32(id)),
- Message: msg,
- })
- }
- return Marshal(ms)
}
// UnmarshalMessageSet decodes the extension map encoded in buf in the message set wire format.
-// It is called by generated Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
+// It is called by Unmarshal methods on protocol buffer messages with the message_set_wire_format option.
func UnmarshalMessageSet(buf []byte, exts interface{}) error {
var m map[int32]Extension
switch exts := exts.(type) {
@@ -235,7 +229,15 @@ func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
var m map[int32]Extension
switch exts := exts.(type) {
case *XXX_InternalExtensions:
- m, _ = exts.extensionsRead()
+ var mu sync.Locker
+ m, mu = exts.extensionsRead()
+ if m != nil {
+ // Keep the extensions map locked until we're done marshaling to prevent
+ // races between marshaling and unmarshaling the lazily-{en,de}coded
+ // values.
+ mu.Lock()
+ defer mu.Unlock()
+ }
case map[int32]Extension:
m = exts
default:
@@ -253,15 +255,16 @@ func MarshalMessageSetJSON(exts interface{}) ([]byte, error) {
for i, id := range ids {
ext := m[id]
- if i > 0 {
- b.WriteByte(',')
- }
-
msd, ok := messageSetMap[id]
if !ok {
// Unknown type; we can't render it, so skip it.
continue
}
+
+ if i > 0 && b.Len() > 1 {
+ b.WriteByte(',')
+ }
+
fmt.Fprintf(&b, `"[%s]":`, msd.name)
x := ext.value
diff --git a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
index fb512e2e1..b6cad9083 100644
--- a/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
+++ b/vendor/github.com/golang/protobuf/proto/pointer_reflect.go
@@ -29,7 +29,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// +build appengine js
+// +build purego appengine js
// This file contains an implementation of proto field accesses using package reflect.
// It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
@@ -38,32 +38,13 @@
package proto
import (
- "math"
"reflect"
+ "sync"
)
-// A structPointer is a pointer to a struct.
-type structPointer struct {
- v reflect.Value
-}
-
-// toStructPointer returns a structPointer equivalent to the given reflect value.
-// The reflect value must itself be a pointer to a struct.
-func toStructPointer(v reflect.Value) structPointer {
- return structPointer{v}
-}
-
-// IsNil reports whether p is nil.
-func structPointer_IsNil(p structPointer) bool {
- return p.v.IsNil()
-}
+const unsafeAllowed = false
-// Interface returns the struct pointer as an interface value.
-func structPointer_Interface(p structPointer, _ reflect.Type) interface{} {
- return p.v.Interface()
-}
-
-// A field identifies a field in a struct, accessible from a structPointer.
+// A field identifies a field in a struct, accessible from a pointer.
// In this implementation, a field is identified by the sequence of field indices
// passed to reflect's FieldByIndex.
type field []int
@@ -76,409 +57,301 @@ func toField(f *reflect.StructField) field {
// invalidField is an invalid field identifier.
var invalidField = field(nil)
+// zeroField is a noop when calling pointer.offset.
+var zeroField = field([]int{})
+
// IsValid reports whether the field identifier is valid.
func (f field) IsValid() bool { return f != nil }
-// field returns the given field in the struct as a reflect value.
-func structPointer_field(p structPointer, f field) reflect.Value {
- // Special case: an extension map entry with a value of type T
- // passes a *T to the struct-handling code with a zero field,
- // expecting that it will be treated as equivalent to *struct{ X T },
- // which has the same memory layout. We have to handle that case
- // specially, because reflect will panic if we call FieldByIndex on a
- // non-struct.
- if f == nil {
- return p.v.Elem()
- }
-
- return p.v.Elem().FieldByIndex(f)
+// The pointer type is for the table-driven decoder.
+// The implementation here uses a reflect.Value of pointer type to
+// create a generic pointer. In pointer_unsafe.go we use unsafe
+// instead of reflect to implement the same (but faster) interface.
+type pointer struct {
+ v reflect.Value
}
-// ifield returns the given field in the struct as an interface value.
-func structPointer_ifield(p structPointer, f field) interface{} {
- return structPointer_field(p, f).Addr().Interface()
+// toPointer converts an interface of pointer type to a pointer
+// that points to the same target.
+func toPointer(i *Message) pointer {
+ return pointer{v: reflect.ValueOf(*i)}
}
-// Bytes returns the address of a []byte field in the struct.
-func structPointer_Bytes(p structPointer, f field) *[]byte {
- return structPointer_ifield(p, f).(*[]byte)
+// toAddrPointer converts an interface to a pointer that points to
+// the interface data.
+func toAddrPointer(i *interface{}, isptr bool) pointer {
+ v := reflect.ValueOf(*i)
+ u := reflect.New(v.Type())
+ u.Elem().Set(v)
+ return pointer{v: u}
}
-// BytesSlice returns the address of a [][]byte field in the struct.
-func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
- return structPointer_ifield(p, f).(*[][]byte)
+// valToPointer converts v to a pointer. v must be of pointer type.
+func valToPointer(v reflect.Value) pointer {
+ return pointer{v: v}
}
-// Bool returns the address of a *bool field in the struct.
-func structPointer_Bool(p structPointer, f field) **bool {
- return structPointer_ifield(p, f).(**bool)
+// offset converts from a pointer to a structure to a pointer to
+// one of its fields.
+func (p pointer) offset(f field) pointer {
+ return pointer{v: p.v.Elem().FieldByIndex(f).Addr()}
}
-// BoolVal returns the address of a bool field in the struct.
-func structPointer_BoolVal(p structPointer, f field) *bool {
- return structPointer_ifield(p, f).(*bool)
+func (p pointer) isNil() bool {
+ return p.v.IsNil()
}
-// BoolSlice returns the address of a []bool field in the struct.
-func structPointer_BoolSlice(p structPointer, f field) *[]bool {
- return structPointer_ifield(p, f).(*[]bool)
+// grow updates the slice s in place to make it one element longer.
+// s must be addressable.
+// Returns the (addressable) new element.
+func grow(s reflect.Value) reflect.Value {
+ n, m := s.Len(), s.Cap()
+ if n < m {
+ s.SetLen(n + 1)
+ } else {
+ s.Set(reflect.Append(s, reflect.Zero(s.Type().Elem())))
+ }
+ return s.Index(n)
}
-// String returns the address of a *string field in the struct.
-func structPointer_String(p structPointer, f field) **string {
- return structPointer_ifield(p, f).(**string)
+func (p pointer) toInt64() *int64 {
+ return p.v.Interface().(*int64)
}
-
-// StringVal returns the address of a string field in the struct.
-func structPointer_StringVal(p structPointer, f field) *string {
- return structPointer_ifield(p, f).(*string)
+func (p pointer) toInt64Ptr() **int64 {
+ return p.v.Interface().(**int64)
}
-
-// StringSlice returns the address of a []string field in the struct.
-func structPointer_StringSlice(p structPointer, f field) *[]string {
- return structPointer_ifield(p, f).(*[]string)
+func (p pointer) toInt64Slice() *[]int64 {
+ return p.v.Interface().(*[]int64)
}
-// Extensions returns the address of an extension map field in the struct.
-func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
- return structPointer_ifield(p, f).(*XXX_InternalExtensions)
-}
+var int32ptr = reflect.TypeOf((*int32)(nil))
-// ExtMap returns the address of an extension map field in the struct.
-func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
- return structPointer_ifield(p, f).(*map[int32]Extension)
+func (p pointer) toInt32() *int32 {
+ return p.v.Convert(int32ptr).Interface().(*int32)
}
-// NewAt returns the reflect.Value for a pointer to a field in the struct.
-func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
- return structPointer_field(p, f).Addr()
+// The toInt32Ptr/Slice methods don't work because of enums.
+// Instead, we must use set/get methods for the int32ptr/slice case.
+/*
+ func (p pointer) toInt32Ptr() **int32 {
+ return p.v.Interface().(**int32)
}
-
-// SetStructPointer writes a *struct field in the struct.
-func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
- structPointer_field(p, f).Set(q.v)
+ func (p pointer) toInt32Slice() *[]int32 {
+ return p.v.Interface().(*[]int32)
}
-
-// GetStructPointer reads a *struct field in the struct.
-func structPointer_GetStructPointer(p structPointer, f field) structPointer {
- return structPointer{structPointer_field(p, f)}
+*/
+func (p pointer) getInt32Ptr() *int32 {
+ if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
+ // raw int32 type
+ return p.v.Elem().Interface().(*int32)
+ }
+ // an enum
+ return p.v.Elem().Convert(int32PtrType).Interface().(*int32)
+}
+func (p pointer) setInt32Ptr(v int32) {
+ // Allocate value in a *int32. Possibly convert that to a *enum.
+ // Then assign it to a **int32 or **enum.
+ // Note: we can convert *int32 to *enum, but we can't convert
+ // **int32 to **enum!
+ p.v.Elem().Set(reflect.ValueOf(&v).Convert(p.v.Type().Elem()))
+}
+
+// getInt32Slice copies []int32 from p as a new slice.
+// This behavior differs from the implementation in pointer_unsafe.go.
+func (p pointer) getInt32Slice() []int32 {
+ if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
+ // raw int32 type
+ return p.v.Elem().Interface().([]int32)
+ }
+ // an enum
+ // Allocate a []int32, then assign []enum's values into it.
+ // Note: we can't convert []enum to []int32.
+ slice := p.v.Elem()
+ s := make([]int32, slice.Len())
+ for i := 0; i < slice.Len(); i++ {
+ s[i] = int32(slice.Index(i).Int())
+ }
+ return s
}
-// StructPointerSlice the address of a []*struct field in the struct.
-func structPointer_StructPointerSlice(p structPointer, f field) structPointerSlice {
- return structPointerSlice{structPointer_field(p, f)}
+// setInt32Slice copies []int32 into p as a new slice.
+// This behavior differs from the implementation in pointer_unsafe.go.
+func (p pointer) setInt32Slice(v []int32) {
+ if p.v.Type().Elem().Elem() == reflect.TypeOf(int32(0)) {
+ // raw int32 type
+ p.v.Elem().Set(reflect.ValueOf(v))
+ return
+ }
+ // an enum
+ // Allocate a []enum, then assign []int32's values into it.
+ // Note: we can't convert []enum to []int32.
+ slice := reflect.MakeSlice(p.v.Type().Elem(), len(v), cap(v))
+ for i, x := range v {
+ slice.Index(i).SetInt(int64(x))
+ }
+ p.v.Elem().Set(slice)
}
-
-// A structPointerSlice represents the address of a slice of pointers to structs
-// (themselves messages or groups). That is, v.Type() is *[]*struct{...}.
-type structPointerSlice struct {
- v reflect.Value
+func (p pointer) appendInt32Slice(v int32) {
+ grow(p.v.Elem()).SetInt(int64(v))
}
-func (p structPointerSlice) Len() int { return p.v.Len() }
-func (p structPointerSlice) Index(i int) structPointer { return structPointer{p.v.Index(i)} }
-func (p structPointerSlice) Append(q structPointer) {
- p.v.Set(reflect.Append(p.v, q.v))
+func (p pointer) toUint64() *uint64 {
+ return p.v.Interface().(*uint64)
}
-
-var (
- int32Type = reflect.TypeOf(int32(0))
- uint32Type = reflect.TypeOf(uint32(0))
- float32Type = reflect.TypeOf(float32(0))
- int64Type = reflect.TypeOf(int64(0))
- uint64Type = reflect.TypeOf(uint64(0))
- float64Type = reflect.TypeOf(float64(0))
-)
-
-// A word32 represents a field of type *int32, *uint32, *float32, or *enum.
-// That is, v.Type() is *int32, *uint32, *float32, or *enum and v is assignable.
-type word32 struct {
- v reflect.Value
+func (p pointer) toUint64Ptr() **uint64 {
+ return p.v.Interface().(**uint64)
}
-
-// IsNil reports whether p is nil.
-func word32_IsNil(p word32) bool {
- return p.v.IsNil()
+func (p pointer) toUint64Slice() *[]uint64 {
+ return p.v.Interface().(*[]uint64)
}
-
-// Set sets p to point at a newly allocated word with bits set to x.
-func word32_Set(p word32, o *Buffer, x uint32) {
- t := p.v.Type().Elem()
- switch t {
- case int32Type:
- if len(o.int32s) == 0 {
- o.int32s = make([]int32, uint32PoolSize)
- }
- o.int32s[0] = int32(x)
- p.v.Set(reflect.ValueOf(&o.int32s[0]))
- o.int32s = o.int32s[1:]
- return
- case uint32Type:
- if len(o.uint32s) == 0 {
- o.uint32s = make([]uint32, uint32PoolSize)
- }
- o.uint32s[0] = x
- p.v.Set(reflect.ValueOf(&o.uint32s[0]))
- o.uint32s = o.uint32s[1:]
- return
- case float32Type:
- if len(o.float32s) == 0 {
- o.float32s = make([]float32, uint32PoolSize)
- }
- o.float32s[0] = math.Float32frombits(x)
- p.v.Set(reflect.ValueOf(&o.float32s[0]))
- o.float32s = o.float32s[1:]
- return
- }
-
- // must be enum
- p.v.Set(reflect.New(t))
- p.v.Elem().SetInt(int64(int32(x)))
+func (p pointer) toUint32() *uint32 {
+ return p.v.Interface().(*uint32)
}
-
-// Get gets the bits pointed at by p, as a uint32.
-func word32_Get(p word32) uint32 {
- elem := p.v.Elem()
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
+func (p pointer) toUint32Ptr() **uint32 {
+ return p.v.Interface().(**uint32)
}
-
-// Word32 returns a reference to a *int32, *uint32, *float32, or *enum field in the struct.
-func structPointer_Word32(p structPointer, f field) word32 {
- return word32{structPointer_field(p, f)}
+func (p pointer) toUint32Slice() *[]uint32 {
+ return p.v.Interface().(*[]uint32)
}
-
-// A word32Val represents a field of type int32, uint32, float32, or enum.
-// That is, v.Type() is int32, uint32, float32, or enum and v is assignable.
-type word32Val struct {
- v reflect.Value
+func (p pointer) toBool() *bool {
+ return p.v.Interface().(*bool)
}
-
-// Set sets *p to x.
-func word32Val_Set(p word32Val, x uint32) {
- switch p.v.Type() {
- case int32Type:
- p.v.SetInt(int64(x))
- return
- case uint32Type:
- p.v.SetUint(uint64(x))
- return
- case float32Type:
- p.v.SetFloat(float64(math.Float32frombits(x)))
- return
- }
-
- // must be enum
- p.v.SetInt(int64(int32(x)))
+func (p pointer) toBoolPtr() **bool {
+ return p.v.Interface().(**bool)
}
-
-// Get gets the bits pointed at by p, as a uint32.
-func word32Val_Get(p word32Val) uint32 {
- elem := p.v
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
+func (p pointer) toBoolSlice() *[]bool {
+ return p.v.Interface().(*[]bool)
}
-
-// Word32Val returns a reference to a int32, uint32, float32, or enum field in the struct.
-func structPointer_Word32Val(p structPointer, f field) word32Val {
- return word32Val{structPointer_field(p, f)}
+func (p pointer) toFloat64() *float64 {
+ return p.v.Interface().(*float64)
}
-
-// A word32Slice is a slice of 32-bit values.
-// That is, v.Type() is []int32, []uint32, []float32, or []enum.
-type word32Slice struct {
- v reflect.Value
+func (p pointer) toFloat64Ptr() **float64 {
+ return p.v.Interface().(**float64)
}
-
-func (p word32Slice) Append(x uint32) {
- n, m := p.v.Len(), p.v.Cap()
- if n < m {
- p.v.SetLen(n + 1)
- } else {
- t := p.v.Type().Elem()
- p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
- }
- elem := p.v.Index(n)
- switch elem.Kind() {
- case reflect.Int32:
- elem.SetInt(int64(int32(x)))
- case reflect.Uint32:
- elem.SetUint(uint64(x))
- case reflect.Float32:
- elem.SetFloat(float64(math.Float32frombits(x)))
- }
+func (p pointer) toFloat64Slice() *[]float64 {
+ return p.v.Interface().(*[]float64)
}
-
-func (p word32Slice) Len() int {
- return p.v.Len()
+func (p pointer) toFloat32() *float32 {
+ return p.v.Interface().(*float32)
}
-
-func (p word32Slice) Index(i int) uint32 {
- elem := p.v.Index(i)
- switch elem.Kind() {
- case reflect.Int32:
- return uint32(elem.Int())
- case reflect.Uint32:
- return uint32(elem.Uint())
- case reflect.Float32:
- return math.Float32bits(float32(elem.Float()))
- }
- panic("unreachable")
+func (p pointer) toFloat32Ptr() **float32 {
+ return p.v.Interface().(**float32)
}
-
-// Word32Slice returns a reference to a []int32, []uint32, []float32, or []enum field in the struct.
-func structPointer_Word32Slice(p structPointer, f field) word32Slice {
- return word32Slice{structPointer_field(p, f)}
+func (p pointer) toFloat32Slice() *[]float32 {
+ return p.v.Interface().(*[]float32)
}
-
-// word64 is like word32 but for 64-bit values.
-type word64 struct {
- v reflect.Value
+func (p pointer) toString() *string {
+ return p.v.Interface().(*string)
}
-
-func word64_Set(p word64, o *Buffer, x uint64) {
- t := p.v.Type().Elem()
- switch t {
- case int64Type:
- if len(o.int64s) == 0 {
- o.int64s = make([]int64, uint64PoolSize)
- }
- o.int64s[0] = int64(x)
- p.v.Set(reflect.ValueOf(&o.int64s[0]))
- o.int64s = o.int64s[1:]
- return
- case uint64Type:
- if len(o.uint64s) == 0 {
- o.uint64s = make([]uint64, uint64PoolSize)
- }
- o.uint64s[0] = x
- p.v.Set(reflect.ValueOf(&o.uint64s[0]))
- o.uint64s = o.uint64s[1:]
- return
- case float64Type:
- if len(o.float64s) == 0 {
- o.float64s = make([]float64, uint64PoolSize)
- }
- o.float64s[0] = math.Float64frombits(x)
- p.v.Set(reflect.ValueOf(&o.float64s[0]))
- o.float64s = o.float64s[1:]
- return
- }
- panic("unreachable")
+func (p pointer) toStringPtr() **string {
+ return p.v.Interface().(**string)
}
-
-func word64_IsNil(p word64) bool {
- return p.v.IsNil()
+func (p pointer) toStringSlice() *[]string {
+ return p.v.Interface().(*[]string)
}
-
-func word64_Get(p word64) uint64 {
- elem := p.v.Elem()
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return elem.Uint()
- case reflect.Float64:
- return math.Float64bits(elem.Float())
- }
- panic("unreachable")
+func (p pointer) toBytes() *[]byte {
+ return p.v.Interface().(*[]byte)
}
-
-func structPointer_Word64(p structPointer, f field) word64 {
- return word64{structPointer_field(p, f)}
+func (p pointer) toBytesSlice() *[][]byte {
+ return p.v.Interface().(*[][]byte)
+}
+func (p pointer) toExtensions() *XXX_InternalExtensions {
+ return p.v.Interface().(*XXX_InternalExtensions)
+}
+func (p pointer) toOldExtensions() *map[int32]Extension {
+ return p.v.Interface().(*map[int32]Extension)
+}
+func (p pointer) getPointer() pointer {
+ return pointer{v: p.v.Elem()}
+}
+func (p pointer) setPointer(q pointer) {
+ p.v.Elem().Set(q.v)
+}
+func (p pointer) appendPointer(q pointer) {
+ grow(p.v.Elem()).Set(q.v)
}
-// word64Val is like word32Val but for 64-bit values.
-type word64Val struct {
- v reflect.Value
+// getPointerSlice copies []*T from p as a new []pointer.
+// This behavior differs from the implementation in pointer_unsafe.go.
+func (p pointer) getPointerSlice() []pointer {
+ if p.v.IsNil() {
+ return nil
+ }
+ n := p.v.Elem().Len()
+ s := make([]pointer, n)
+ for i := 0; i < n; i++ {
+ s[i] = pointer{v: p.v.Elem().Index(i)}
+ }
+ return s
}
-func word64Val_Set(p word64Val, o *Buffer, x uint64) {
- switch p.v.Type() {
- case int64Type:
- p.v.SetInt(int64(x))
- return
- case uint64Type:
- p.v.SetUint(x)
- return
- case float64Type:
- p.v.SetFloat(math.Float64frombits(x))
+// setPointerSlice copies []pointer into p as a new []*T.
+// This behavior differs from the implementation in pointer_unsafe.go.
+func (p pointer) setPointerSlice(v []pointer) {
+ if v == nil {
+ p.v.Elem().Set(reflect.New(p.v.Elem().Type()).Elem())
return
}
- panic("unreachable")
+ s := reflect.MakeSlice(p.v.Elem().Type(), 0, len(v))
+ for _, p := range v {
+ s = reflect.Append(s, p.v)
+ }
+ p.v.Elem().Set(s)
}
-func word64Val_Get(p word64Val) uint64 {
- elem := p.v
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return elem.Uint()
- case reflect.Float64:
- return math.Float64bits(elem.Float())
+// getInterfacePointer returns a pointer that points to the
+// interface data of the interface pointed by p.
+func (p pointer) getInterfacePointer() pointer {
+ if p.v.Elem().IsNil() {
+ return pointer{v: p.v.Elem()}
}
- panic("unreachable")
+ return pointer{v: p.v.Elem().Elem().Elem().Field(0).Addr()} // *interface -> interface -> *struct -> struct
}
-func structPointer_Word64Val(p structPointer, f field) word64Val {
- return word64Val{structPointer_field(p, f)}
+func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
+ // TODO: check that p.v.Type().Elem() == t?
+ return p.v
}
-type word64Slice struct {
- v reflect.Value
+func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ return *p
}
-
-func (p word64Slice) Append(x uint64) {
- n, m := p.v.Len(), p.v.Cap()
- if n < m {
- p.v.SetLen(n + 1)
- } else {
- t := p.v.Type().Elem()
- p.v.Set(reflect.Append(p.v, reflect.Zero(t)))
- }
- elem := p.v.Index(n)
- switch elem.Kind() {
- case reflect.Int64:
- elem.SetInt(int64(int64(x)))
- case reflect.Uint64:
- elem.SetUint(uint64(x))
- case reflect.Float64:
- elem.SetFloat(float64(math.Float64frombits(x)))
- }
+func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ *p = v
}
-
-func (p word64Slice) Len() int {
- return p.v.Len()
+func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ return *p
}
-
-func (p word64Slice) Index(i int) uint64 {
- elem := p.v.Index(i)
- switch elem.Kind() {
- case reflect.Int64:
- return uint64(elem.Int())
- case reflect.Uint64:
- return uint64(elem.Uint())
- case reflect.Float64:
- return math.Float64bits(float64(elem.Float()))
- }
- panic("unreachable")
+func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ *p = v
}
-
-func structPointer_Word64Slice(p structPointer, f field) word64Slice {
- return word64Slice{structPointer_field(p, f)}
+func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ return *p
+}
+func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ *p = v
}
+func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ return *p
+}
+func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
+ atomicLock.Lock()
+ defer atomicLock.Unlock()
+ *p = v
+}
+
+var atomicLock sync.Mutex
diff --git a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
index 6b5567d47..d55a335d9 100644
--- a/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
+++ b/vendor/github.com/golang/protobuf/proto/pointer_unsafe.go
@@ -29,7 +29,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// +build !appengine,!js
+// +build !purego,!appengine,!js
// This file contains the implementation of the proto field accesses using package unsafe.
@@ -37,38 +37,13 @@ package proto
import (
"reflect"
+ "sync/atomic"
"unsafe"
)
-// NOTE: These type_Foo functions would more idiomatically be methods,
-// but Go does not allow methods on pointer types, and we must preserve
-// some pointer type for the garbage collector. We use these
-// funcs with clunky names as our poor approximation to methods.
-//
-// An alternative would be
-// type structPointer struct { p unsafe.Pointer }
-// but that does not registerize as well.
-
-// A structPointer is a pointer to a struct.
-type structPointer unsafe.Pointer
-
-// toStructPointer returns a structPointer equivalent to the given reflect value.
-func toStructPointer(v reflect.Value) structPointer {
- return structPointer(unsafe.Pointer(v.Pointer()))
-}
-
-// IsNil reports whether p is nil.
-func structPointer_IsNil(p structPointer) bool {
- return p == nil
-}
-
-// Interface returns the struct pointer, assumed to have element type t,
-// as an interface value.
-func structPointer_Interface(p structPointer, t reflect.Type) interface{} {
- return reflect.NewAt(t, unsafe.Pointer(p)).Interface()
-}
+const unsafeAllowed = true
-// A field identifies a field in a struct, accessible from a structPointer.
+// A field identifies a field in a struct, accessible from a pointer.
// In this implementation, a field is identified by its byte offset from the start of the struct.
type field uintptr
@@ -80,191 +55,254 @@ func toField(f *reflect.StructField) field {
// invalidField is an invalid field identifier.
const invalidField = ^field(0)
+// zeroField is a noop when calling pointer.offset.
+const zeroField = field(0)
+
// IsValid reports whether the field identifier is valid.
func (f field) IsValid() bool {
- return f != ^field(0)
+ return f != invalidField
}
-// Bytes returns the address of a []byte field in the struct.
-func structPointer_Bytes(p structPointer, f field) *[]byte {
- return (*[]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// The pointer type below is for the new table-driven encoder/decoder.
+// The implementation here uses unsafe.Pointer to create a generic pointer.
+// In pointer_reflect.go we use reflect instead of unsafe to implement
+// the same (but slower) interface.
+type pointer struct {
+ p unsafe.Pointer
}
-// BytesSlice returns the address of a [][]byte field in the struct.
-func structPointer_BytesSlice(p structPointer, f field) *[][]byte {
- return (*[][]byte)(unsafe.Pointer(uintptr(p) + uintptr(f)))
-}
+// size of pointer
+var ptrSize = unsafe.Sizeof(uintptr(0))
-// Bool returns the address of a *bool field in the struct.
-func structPointer_Bool(p structPointer, f field) **bool {
- return (**bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// toPointer converts an interface of pointer type to a pointer
+// that points to the same target.
+func toPointer(i *Message) pointer {
+ // Super-tricky - read pointer out of data word of interface value.
+ // Saves ~25ns over the equivalent:
+ // return valToPointer(reflect.ValueOf(*i))
+ return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
}
-// BoolVal returns the address of a bool field in the struct.
-func structPointer_BoolVal(p structPointer, f field) *bool {
- return (*bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// toAddrPointer converts an interface to a pointer that points to
+// the interface data.
+func toAddrPointer(i *interface{}, isptr bool) pointer {
+ // Super-tricky - read or get the address of data word of interface value.
+ if isptr {
+ // The interface is of pointer type, thus it is a direct interface.
+ // The data word is the pointer data itself. We take its address.
+ return pointer{p: unsafe.Pointer(uintptr(unsafe.Pointer(i)) + ptrSize)}
+ }
+ // The interface is not of pointer type. The data word is the pointer
+ // to the data.
+ return pointer{p: (*[2]unsafe.Pointer)(unsafe.Pointer(i))[1]}
}
-// BoolSlice returns the address of a []bool field in the struct.
-func structPointer_BoolSlice(p structPointer, f field) *[]bool {
- return (*[]bool)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// valToPointer converts v to a pointer. v must be of pointer type.
+func valToPointer(v reflect.Value) pointer {
+ return pointer{p: unsafe.Pointer(v.Pointer())}
}
-// String returns the address of a *string field in the struct.
-func structPointer_String(p structPointer, f field) **string {
- return (**string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// offset converts from a pointer to a structure to a pointer to
+// one of its fields.
+func (p pointer) offset(f field) pointer {
+ // For safety, we should panic if !f.IsValid, however calling panic causes
+ // this to no longer be inlineable, which is a serious performance cost.
+ /*
+ if !f.IsValid() {
+ panic("invalid field")
+ }
+ */
+ return pointer{p: unsafe.Pointer(uintptr(p.p) + uintptr(f))}
}
-// StringVal returns the address of a string field in the struct.
-func structPointer_StringVal(p structPointer, f field) *string {
- return (*string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) isNil() bool {
+ return p.p == nil
}
-// StringSlice returns the address of a []string field in the struct.
-func structPointer_StringSlice(p structPointer, f field) *[]string {
- return (*[]string)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) toInt64() *int64 {
+ return (*int64)(p.p)
}
-
-// ExtMap returns the address of an extension map field in the struct.
-func structPointer_Extensions(p structPointer, f field) *XXX_InternalExtensions {
- return (*XXX_InternalExtensions)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) toInt64Ptr() **int64 {
+ return (**int64)(p.p)
}
-
-func structPointer_ExtMap(p structPointer, f field) *map[int32]Extension {
- return (*map[int32]Extension)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) toInt64Slice() *[]int64 {
+ return (*[]int64)(p.p)
}
-
-// NewAt returns the reflect.Value for a pointer to a field in the struct.
-func structPointer_NewAt(p structPointer, f field, typ reflect.Type) reflect.Value {
- return reflect.NewAt(typ, unsafe.Pointer(uintptr(p)+uintptr(f)))
+func (p pointer) toInt32() *int32 {
+ return (*int32)(p.p)
}
-// SetStructPointer writes a *struct field in the struct.
-func structPointer_SetStructPointer(p structPointer, f field, q structPointer) {
- *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f))) = q
+// See pointer_reflect.go for why toInt32Ptr/Slice doesn't exist.
+/*
+ func (p pointer) toInt32Ptr() **int32 {
+ return (**int32)(p.p)
+ }
+ func (p pointer) toInt32Slice() *[]int32 {
+ return (*[]int32)(p.p)
+ }
+*/
+func (p pointer) getInt32Ptr() *int32 {
+ return *(**int32)(p.p)
}
-
-// GetStructPointer reads a *struct field in the struct.
-func structPointer_GetStructPointer(p structPointer, f field) structPointer {
- return *(*structPointer)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) setInt32Ptr(v int32) {
+ *(**int32)(p.p) = &v
}
-// StructPointerSlice the address of a []*struct field in the struct.
-func structPointer_StructPointerSlice(p structPointer, f field) *structPointerSlice {
- return (*structPointerSlice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+// getInt32Slice loads a []int32 from p.
+// The value returned is aliased with the original slice.
+// This behavior differs from the implementation in pointer_reflect.go.
+func (p pointer) getInt32Slice() []int32 {
+ return *(*[]int32)(p.p)
}
-// A structPointerSlice represents a slice of pointers to structs (themselves submessages or groups).
-type structPointerSlice []structPointer
-
-func (v *structPointerSlice) Len() int { return len(*v) }
-func (v *structPointerSlice) Index(i int) structPointer { return (*v)[i] }
-func (v *structPointerSlice) Append(p structPointer) { *v = append(*v, p) }
-
-// A word32 is the address of a "pointer to 32-bit value" field.
-type word32 **uint32
-
-// IsNil reports whether *v is nil.
-func word32_IsNil(p word32) bool {
- return *p == nil
+// setInt32Slice stores a []int32 to p.
+// The value set is aliased with the input slice.
+// This behavior differs from the implementation in pointer_reflect.go.
+func (p pointer) setInt32Slice(v []int32) {
+ *(*[]int32)(p.p) = v
}
-// Set sets *v to point at a newly allocated word set to x.
-func word32_Set(p word32, o *Buffer, x uint32) {
- if len(o.uint32s) == 0 {
- o.uint32s = make([]uint32, uint32PoolSize)
- }
- o.uint32s[0] = x
- *p = &o.uint32s[0]
- o.uint32s = o.uint32s[1:]
+// TODO: Can we get rid of appendInt32Slice and use setInt32Slice instead?
+func (p pointer) appendInt32Slice(v int32) {
+ s := (*[]int32)(p.p)
+ *s = append(*s, v)
}
-// Get gets the value pointed at by *v.
-func word32_Get(p word32) uint32 {
- return **p
+func (p pointer) toUint64() *uint64 {
+ return (*uint64)(p.p)
}
-
-// Word32 returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
-func structPointer_Word32(p structPointer, f field) word32 {
- return word32((**uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
+func (p pointer) toUint64Ptr() **uint64 {
+ return (**uint64)(p.p)
}
-
-// A word32Val is the address of a 32-bit value field.
-type word32Val *uint32
-
-// Set sets *p to x.
-func word32Val_Set(p word32Val, x uint32) {
- *p = x
+func (p pointer) toUint64Slice() *[]uint64 {
+ return (*[]uint64)(p.p)
}
-
-// Get gets the value pointed at by p.
-func word32Val_Get(p word32Val) uint32 {
- return *p
+func (p pointer) toUint32() *uint32 {
+ return (*uint32)(p.p)
}
-
-// Word32Val returns the address of a *int32, *uint32, *float32, or *enum field in the struct.
-func structPointer_Word32Val(p structPointer, f field) word32Val {
- return word32Val((*uint32)(unsafe.Pointer(uintptr(p) + uintptr(f))))
+func (p pointer) toUint32Ptr() **uint32 {
+ return (**uint32)(p.p)
}
-
-// A word32Slice is a slice of 32-bit values.
-type word32Slice []uint32
-
-func (v *word32Slice) Append(x uint32) { *v = append(*v, x) }
-func (v *word32Slice) Len() int { return len(*v) }
-func (v *word32Slice) Index(i int) uint32 { return (*v)[i] }
-
-// Word32Slice returns the address of a []int32, []uint32, []float32, or []enum field in the struct.
-func structPointer_Word32Slice(p structPointer, f field) *word32Slice {
- return (*word32Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func (p pointer) toUint32Slice() *[]uint32 {
+ return (*[]uint32)(p.p)
}
-
-// word64 is like word32 but for 64-bit values.
-type word64 **uint64
-
-func word64_Set(p word64, o *Buffer, x uint64) {
- if len(o.uint64s) == 0 {
- o.uint64s = make([]uint64, uint64PoolSize)
- }
- o.uint64s[0] = x
- *p = &o.uint64s[0]
- o.uint64s = o.uint64s[1:]
+func (p pointer) toBool() *bool {
+ return (*bool)(p.p)
}
-
-func word64_IsNil(p word64) bool {
- return *p == nil
+func (p pointer) toBoolPtr() **bool {
+ return (**bool)(p.p)
}
-
-func word64_Get(p word64) uint64 {
- return **p
+func (p pointer) toBoolSlice() *[]bool {
+ return (*[]bool)(p.p)
+}
+func (p pointer) toFloat64() *float64 {
+ return (*float64)(p.p)
+}
+func (p pointer) toFloat64Ptr() **float64 {
+ return (**float64)(p.p)
+}
+func (p pointer) toFloat64Slice() *[]float64 {
+ return (*[]float64)(p.p)
+}
+func (p pointer) toFloat32() *float32 {
+ return (*float32)(p.p)
+}
+func (p pointer) toFloat32Ptr() **float32 {
+ return (**float32)(p.p)
+}
+func (p pointer) toFloat32Slice() *[]float32 {
+ return (*[]float32)(p.p)
+}
+func (p pointer) toString() *string {
+ return (*string)(p.p)
+}
+func (p pointer) toStringPtr() **string {
+ return (**string)(p.p)
+}
+func (p pointer) toStringSlice() *[]string {
+ return (*[]string)(p.p)
+}
+func (p pointer) toBytes() *[]byte {
+ return (*[]byte)(p.p)
+}
+func (p pointer) toBytesSlice() *[][]byte {
+ return (*[][]byte)(p.p)
+}
+func (p pointer) toExtensions() *XXX_InternalExtensions {
+ return (*XXX_InternalExtensions)(p.p)
+}
+func (p pointer) toOldExtensions() *map[int32]Extension {
+ return (*map[int32]Extension)(p.p)
}
-func structPointer_Word64(p structPointer, f field) word64 {
- return word64((**uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
+// getPointerSlice loads []*T from p as a []pointer.
+// The value returned is aliased with the original slice.
+// This behavior differs from the implementation in pointer_reflect.go.
+func (p pointer) getPointerSlice() []pointer {
+ // Super-tricky - p should point to a []*T where T is a
+ // message type. We load it as []pointer.
+ return *(*[]pointer)(p.p)
}
-// word64Val is like word32Val but for 64-bit values.
-type word64Val *uint64
+// setPointerSlice stores []pointer into p as a []*T.
+// The value set is aliased with the input slice.
+// This behavior differs from the implementation in pointer_reflect.go.
+func (p pointer) setPointerSlice(v []pointer) {
+ // Super-tricky - p should point to a []*T where T is a
+ // message type. We store it as []pointer.
+ *(*[]pointer)(p.p) = v
+}
-func word64Val_Set(p word64Val, o *Buffer, x uint64) {
- *p = x
+// getPointer loads the pointer at p and returns it.
+func (p pointer) getPointer() pointer {
+ return pointer{p: *(*unsafe.Pointer)(p.p)}
}
-func word64Val_Get(p word64Val) uint64 {
- return *p
+// setPointer stores the pointer q at p.
+func (p pointer) setPointer(q pointer) {
+ *(*unsafe.Pointer)(p.p) = q.p
}
-func structPointer_Word64Val(p structPointer, f field) word64Val {
- return word64Val((*uint64)(unsafe.Pointer(uintptr(p) + uintptr(f))))
+// append q to the slice pointed to by p.
+func (p pointer) appendPointer(q pointer) {
+ s := (*[]unsafe.Pointer)(p.p)
+ *s = append(*s, q.p)
}
-// word64Slice is like word32Slice but for 64-bit values.
-type word64Slice []uint64
+// getInterfacePointer returns a pointer that points to the
+// interface data of the interface pointed by p.
+func (p pointer) getInterfacePointer() pointer {
+ // Super-tricky - read pointer out of data word of interface value.
+ return pointer{p: (*(*[2]unsafe.Pointer)(p.p))[1]}
+}
-func (v *word64Slice) Append(x uint64) { *v = append(*v, x) }
-func (v *word64Slice) Len() int { return len(*v) }
-func (v *word64Slice) Index(i int) uint64 { return (*v)[i] }
+// asPointerTo returns a reflect.Value that is a pointer to an
+// object of type t stored at p.
+func (p pointer) asPointerTo(t reflect.Type) reflect.Value {
+ return reflect.NewAt(t, p.p)
+}
-func structPointer_Word64Slice(p structPointer, f field) *word64Slice {
- return (*word64Slice)(unsafe.Pointer(uintptr(p) + uintptr(f)))
+func atomicLoadUnmarshalInfo(p **unmarshalInfo) *unmarshalInfo {
+ return (*unmarshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
+}
+func atomicStoreUnmarshalInfo(p **unmarshalInfo, v *unmarshalInfo) {
+ atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
+}
+func atomicLoadMarshalInfo(p **marshalInfo) *marshalInfo {
+ return (*marshalInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
+}
+func atomicStoreMarshalInfo(p **marshalInfo, v *marshalInfo) {
+ atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
+}
+func atomicLoadMergeInfo(p **mergeInfo) *mergeInfo {
+ return (*mergeInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
+}
+func atomicStoreMergeInfo(p **mergeInfo, v *mergeInfo) {
+ atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
+}
+func atomicLoadDiscardInfo(p **discardInfo) *discardInfo {
+ return (*discardInfo)(atomic.LoadPointer((*unsafe.Pointer)(unsafe.Pointer(p))))
+}
+func atomicStoreDiscardInfo(p **discardInfo, v *discardInfo) {
+ atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(p)), unsafe.Pointer(v))
}
diff --git a/vendor/github.com/golang/protobuf/proto/properties.go b/vendor/github.com/golang/protobuf/proto/properties.go
index ec2289c00..f710adab0 100644
--- a/vendor/github.com/golang/protobuf/proto/properties.go
+++ b/vendor/github.com/golang/protobuf/proto/properties.go
@@ -58,42 +58,6 @@ const (
WireFixed32 = 5
)
-const startSize = 10 // initial slice/string sizes
-
-// Encoders are defined in encode.go
-// An encoder outputs the full representation of a field, including its
-// tag and encoder type.
-type encoder func(p *Buffer, prop *Properties, base structPointer) error
-
-// A valueEncoder encodes a single integer in a particular encoding.
-type valueEncoder func(o *Buffer, x uint64) error
-
-// Sizers are defined in encode.go
-// A sizer returns the encoded size of a field, including its tag and encoder
-// type.
-type sizer func(prop *Properties, base structPointer) int
-
-// A valueSizer returns the encoded size of a single integer in a particular
-// encoding.
-type valueSizer func(x uint64) int
-
-// Decoders are defined in decode.go
-// A decoder creates a value from its wire representation.
-// Unrecognized subelements are saved in unrec.
-type decoder func(p *Buffer, prop *Properties, base structPointer) error
-
-// A valueDecoder decodes a single integer in a particular encoding.
-type valueDecoder func(o *Buffer) (x uint64, err error)
-
-// A oneofMarshaler does the marshaling for all oneof fields in a message.
-type oneofMarshaler func(Message, *Buffer) error
-
-// A oneofUnmarshaler does the unmarshaling for a oneof field in a message.
-type oneofUnmarshaler func(Message, int, int, *Buffer) (bool, error)
-
-// A oneofSizer does the sizing for all oneof fields in a message.
-type oneofSizer func(Message) int
-
// tagMap is an optimization over map[int]int for typical protocol buffer
// use-cases. Encoded protocol buffers are often in tag order with small tag
// numbers.
@@ -140,13 +104,6 @@ type StructProperties struct {
decoderTags tagMap // map from proto tag to struct field number
decoderOrigNames map[string]int // map from original name to struct field number
order []int // list of struct field numbers in tag order
- unrecField field // field id of the XXX_unrecognized []byte field
- extendable bool // is this an extendable proto
-
- oneofMarshaler oneofMarshaler
- oneofUnmarshaler oneofUnmarshaler
- oneofSizer oneofSizer
- stype reflect.Type
// OneofTypes contains information about the oneof fields in this message.
// It is keyed by the original name of a field.
@@ -187,36 +144,19 @@ type Properties struct {
Default string // default value
HasDefault bool // whether an explicit default was provided
- def_uint64 uint64
-
- enc encoder
- valEnc valueEncoder // set for bool and numeric types only
- field field
- tagcode []byte // encoding of EncodeVarint((Tag<<3)|WireType)
- tagbuf [8]byte
- stype reflect.Type // set for struct types only
- sprop *StructProperties // set for struct types only
- isMarshaler bool
- isUnmarshaler bool
+
+ stype reflect.Type // set for struct types only
+ sprop *StructProperties // set for struct types only
mtype reflect.Type // set for map types only
mkeyprop *Properties // set for map types only
mvalprop *Properties // set for map types only
-
- size sizer
- valSize valueSizer // set for bool and numeric types only
-
- dec decoder
- valDec valueDecoder // set for bool and numeric types only
-
- // If this is a packable field, this will be the decoder for the packed version of the field.
- packedDec decoder
}
// String formats the properties in the protobuf struct field tag style.
func (p *Properties) String() string {
s := p.Wire
- s = ","
+ s += ","
s += strconv.Itoa(p.Tag)
if p.Required {
s += ",req"
@@ -262,29 +202,14 @@ func (p *Properties) Parse(s string) {
switch p.Wire {
case "varint":
p.WireType = WireVarint
- p.valEnc = (*Buffer).EncodeVarint
- p.valDec = (*Buffer).DecodeVarint
- p.valSize = sizeVarint
case "fixed32":
p.WireType = WireFixed32
- p.valEnc = (*Buffer).EncodeFixed32
- p.valDec = (*Buffer).DecodeFixed32
- p.valSize = sizeFixed32
case "fixed64":
p.WireType = WireFixed64
- p.valEnc = (*Buffer).EncodeFixed64
- p.valDec = (*Buffer).DecodeFixed64
- p.valSize = sizeFixed64
case "zigzag32":
p.WireType = WireVarint
- p.valEnc = (*Buffer).EncodeZigzag32
- p.valDec = (*Buffer).DecodeZigzag32
- p.valSize = sizeZigzag32
case "zigzag64":
p.WireType = WireVarint
- p.valEnc = (*Buffer).EncodeZigzag64
- p.valDec = (*Buffer).DecodeZigzag64
- p.valSize = sizeZigzag64
case "bytes", "group":
p.WireType = WireBytes
// no numeric converter for non-numeric types
@@ -299,6 +224,7 @@ func (p *Properties) Parse(s string) {
return
}
+outer:
for i := 2; i < len(fields); i++ {
f := fields[i]
switch {
@@ -326,229 +252,28 @@ func (p *Properties) Parse(s string) {
if i+1 < len(fields) {
// Commas aren't escaped, and def is always last.
p.Default += "," + strings.Join(fields[i+1:], ",")
- break
+ break outer
}
}
}
}
-func logNoSliceEnc(t1, t2 reflect.Type) {
- fmt.Fprintf(os.Stderr, "proto: no slice oenc for %T = []%T\n", t1, t2)
-}
-
var protoMessageType = reflect.TypeOf((*Message)(nil)).Elem()
-// Initialize the fields for encoding and decoding.
-func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
- p.enc = nil
- p.dec = nil
- p.size = nil
-
+// setFieldProps initializes the field properties for submessages and maps.
+func (p *Properties) setFieldProps(typ reflect.Type, f *reflect.StructField, lockGetProp bool) {
switch t1 := typ; t1.Kind() {
- default:
- fmt.Fprintf(os.Stderr, "proto: no coders for %v\n", t1)
-
- // proto3 scalar types
-
- case reflect.Bool:
- p.enc = (*Buffer).enc_proto3_bool
- p.dec = (*Buffer).dec_proto3_bool
- p.size = size_proto3_bool
- case reflect.Int32:
- p.enc = (*Buffer).enc_proto3_int32
- p.dec = (*Buffer).dec_proto3_int32
- p.size = size_proto3_int32
- case reflect.Uint32:
- p.enc = (*Buffer).enc_proto3_uint32
- p.dec = (*Buffer).dec_proto3_int32 // can reuse
- p.size = size_proto3_uint32
- case reflect.Int64, reflect.Uint64:
- p.enc = (*Buffer).enc_proto3_int64
- p.dec = (*Buffer).dec_proto3_int64
- p.size = size_proto3_int64
- case reflect.Float32:
- p.enc = (*Buffer).enc_proto3_uint32 // can just treat them as bits
- p.dec = (*Buffer).dec_proto3_int32
- p.size = size_proto3_uint32
- case reflect.Float64:
- p.enc = (*Buffer).enc_proto3_int64 // can just treat them as bits
- p.dec = (*Buffer).dec_proto3_int64
- p.size = size_proto3_int64
- case reflect.String:
- p.enc = (*Buffer).enc_proto3_string
- p.dec = (*Buffer).dec_proto3_string
- p.size = size_proto3_string
-
case reflect.Ptr:
- switch t2 := t1.Elem(); t2.Kind() {
- default:
- fmt.Fprintf(os.Stderr, "proto: no encoder function for %v -> %v\n", t1, t2)
- break
- case reflect.Bool:
- p.enc = (*Buffer).enc_bool
- p.dec = (*Buffer).dec_bool
- p.size = size_bool
- case reflect.Int32:
- p.enc = (*Buffer).enc_int32
- p.dec = (*Buffer).dec_int32
- p.size = size_int32
- case reflect.Uint32:
- p.enc = (*Buffer).enc_uint32
- p.dec = (*Buffer).dec_int32 // can reuse
- p.size = size_uint32
- case reflect.Int64, reflect.Uint64:
- p.enc = (*Buffer).enc_int64
- p.dec = (*Buffer).dec_int64
- p.size = size_int64
- case reflect.Float32:
- p.enc = (*Buffer).enc_uint32 // can just treat them as bits
- p.dec = (*Buffer).dec_int32
- p.size = size_uint32
- case reflect.Float64:
- p.enc = (*Buffer).enc_int64 // can just treat them as bits
- p.dec = (*Buffer).dec_int64
- p.size = size_int64
- case reflect.String:
- p.enc = (*Buffer).enc_string
- p.dec = (*Buffer).dec_string
- p.size = size_string
- case reflect.Struct:
+ if t1.Elem().Kind() == reflect.Struct {
p.stype = t1.Elem()
- p.isMarshaler = isMarshaler(t1)
- p.isUnmarshaler = isUnmarshaler(t1)
- if p.Wire == "bytes" {
- p.enc = (*Buffer).enc_struct_message
- p.dec = (*Buffer).dec_struct_message
- p.size = size_struct_message
- } else {
- p.enc = (*Buffer).enc_struct_group
- p.dec = (*Buffer).dec_struct_group
- p.size = size_struct_group
- }
}
case reflect.Slice:
- switch t2 := t1.Elem(); t2.Kind() {
- default:
- logNoSliceEnc(t1, t2)
- break
- case reflect.Bool:
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_bool
- p.size = size_slice_packed_bool
- } else {
- p.enc = (*Buffer).enc_slice_bool
- p.size = size_slice_bool
- }
- p.dec = (*Buffer).dec_slice_bool
- p.packedDec = (*Buffer).dec_slice_packed_bool
- case reflect.Int32:
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_int32
- p.size = size_slice_packed_int32
- } else {
- p.enc = (*Buffer).enc_slice_int32
- p.size = size_slice_int32
- }
- p.dec = (*Buffer).dec_slice_int32
- p.packedDec = (*Buffer).dec_slice_packed_int32
- case reflect.Uint32:
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_uint32
- p.size = size_slice_packed_uint32
- } else {
- p.enc = (*Buffer).enc_slice_uint32
- p.size = size_slice_uint32
- }
- p.dec = (*Buffer).dec_slice_int32
- p.packedDec = (*Buffer).dec_slice_packed_int32
- case reflect.Int64, reflect.Uint64:
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_int64
- p.size = size_slice_packed_int64
- } else {
- p.enc = (*Buffer).enc_slice_int64
- p.size = size_slice_int64
- }
- p.dec = (*Buffer).dec_slice_int64
- p.packedDec = (*Buffer).dec_slice_packed_int64
- case reflect.Uint8:
- p.dec = (*Buffer).dec_slice_byte
- if p.proto3 {
- p.enc = (*Buffer).enc_proto3_slice_byte
- p.size = size_proto3_slice_byte
- } else {
- p.enc = (*Buffer).enc_slice_byte
- p.size = size_slice_byte
- }
- case reflect.Float32, reflect.Float64:
- switch t2.Bits() {
- case 32:
- // can just treat them as bits
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_uint32
- p.size = size_slice_packed_uint32
- } else {
- p.enc = (*Buffer).enc_slice_uint32
- p.size = size_slice_uint32
- }
- p.dec = (*Buffer).dec_slice_int32
- p.packedDec = (*Buffer).dec_slice_packed_int32
- case 64:
- // can just treat them as bits
- if p.Packed {
- p.enc = (*Buffer).enc_slice_packed_int64
- p.size = size_slice_packed_int64
- } else {
- p.enc = (*Buffer).enc_slice_int64
- p.size = size_slice_int64
- }
- p.dec = (*Buffer).dec_slice_int64
- p.packedDec = (*Buffer).dec_slice_packed_int64
- default:
- logNoSliceEnc(t1, t2)
- break
- }
- case reflect.String:
- p.enc = (*Buffer).enc_slice_string
- p.dec = (*Buffer).dec_slice_string
- p.size = size_slice_string
- case reflect.Ptr:
- switch t3 := t2.Elem(); t3.Kind() {
- default:
- fmt.Fprintf(os.Stderr, "proto: no ptr oenc for %T -> %T -> %T\n", t1, t2, t3)
- break
- case reflect.Struct:
- p.stype = t2.Elem()
- p.isMarshaler = isMarshaler(t2)
- p.isUnmarshaler = isUnmarshaler(t2)
- if p.Wire == "bytes" {
- p.enc = (*Buffer).enc_slice_struct_message
- p.dec = (*Buffer).dec_slice_struct_message
- p.size = size_slice_struct_message
- } else {
- p.enc = (*Buffer).enc_slice_struct_group
- p.dec = (*Buffer).dec_slice_struct_group
- p.size = size_slice_struct_group
- }
- }
- case reflect.Slice:
- switch t2.Elem().Kind() {
- default:
- fmt.Fprintf(os.Stderr, "proto: no slice elem oenc for %T -> %T -> %T\n", t1, t2, t2.Elem())
- break
- case reflect.Uint8:
- p.enc = (*Buffer).enc_slice_slice_byte
- p.dec = (*Buffer).dec_slice_slice_byte
- p.size = size_slice_slice_byte
- }
+ if t2 := t1.Elem(); t2.Kind() == reflect.Ptr && t2.Elem().Kind() == reflect.Struct {
+ p.stype = t2.Elem()
}
case reflect.Map:
- p.enc = (*Buffer).enc_new_map
- p.dec = (*Buffer).dec_new_map
- p.size = size_new_map
-
p.mtype = t1
p.mkeyprop = &Properties{}
p.mkeyprop.init(reflect.PtrTo(p.mtype.Key()), "Key", f.Tag.Get("protobuf_key"), nil, lockGetProp)
@@ -562,20 +287,6 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock
p.mvalprop.init(vtype, "Value", f.Tag.Get("protobuf_val"), nil, lockGetProp)
}
- // precalculate tag code
- wire := p.WireType
- if p.Packed {
- wire = WireBytes
- }
- x := uint32(p.Tag)<<3 | uint32(wire)
- i := 0
- for i = 0; x > 127; i++ {
- p.tagbuf[i] = 0x80 | uint8(x&0x7F)
- x >>= 7
- }
- p.tagbuf[i] = uint8(x)
- p.tagcode = p.tagbuf[0 : i+1]
-
if p.stype != nil {
if lockGetProp {
p.sprop = GetProperties(p.stype)
@@ -586,32 +297,9 @@ func (p *Properties) setEncAndDec(typ reflect.Type, f *reflect.StructField, lock
}
var (
- marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
- unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem()
+ marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem()
)
-// isMarshaler reports whether type t implements Marshaler.
-func isMarshaler(t reflect.Type) bool {
- // We're checking for (likely) pointer-receiver methods
- // so if t is not a pointer, something is very wrong.
- // The calls above only invoke isMarshaler on pointer types.
- if t.Kind() != reflect.Ptr {
- panic("proto: misuse of isMarshaler")
- }
- return t.Implements(marshalerType)
-}
-
-// isUnmarshaler reports whether type t implements Unmarshaler.
-func isUnmarshaler(t reflect.Type) bool {
- // We're checking for (likely) pointer-receiver methods
- // so if t is not a pointer, something is very wrong.
- // The calls above only invoke isUnmarshaler on pointer types.
- if t.Kind() != reflect.Ptr {
- panic("proto: misuse of isUnmarshaler")
- }
- return t.Implements(unmarshalerType)
-}
-
// Init populates the properties from a protocol buffer struct tag.
func (p *Properties) Init(typ reflect.Type, name, tag string, f *reflect.StructField) {
p.init(typ, name, tag, f, true)
@@ -621,14 +309,11 @@ func (p *Properties) init(typ reflect.Type, name, tag string, f *reflect.StructF
// "bytes,49,opt,def=hello!"
p.Name = name
p.OrigName = name
- if f != nil {
- p.field = toField(f)
- }
if tag == "" {
return
}
p.Parse(tag)
- p.setEncAndDec(typ, f, lockGetProp)
+ p.setFieldProps(typ, f, lockGetProp)
}
var (
@@ -678,9 +363,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
propertiesMap[t] = prop
// build properties
- prop.extendable = reflect.PtrTo(t).Implements(extendableProtoType) ||
- reflect.PtrTo(t).Implements(extendableProtoV1Type)
- prop.unrecField = invalidField
prop.Prop = make([]*Properties, t.NumField())
prop.order = make([]int, t.NumField())
@@ -690,17 +372,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
name := f.Name
p.init(f.Type, name, f.Tag.Get("protobuf"), &f, false)
- if f.Name == "XXX_InternalExtensions" { // special case
- p.enc = (*Buffer).enc_exts
- p.dec = nil // not needed
- p.size = size_exts
- } else if f.Name == "XXX_extensions" { // special case
- p.enc = (*Buffer).enc_map
- p.dec = nil // not needed
- p.size = size_map
- } else if f.Name == "XXX_unrecognized" { // special case
- prop.unrecField = toField(&f)
- }
oneof := f.Tag.Get("protobuf_oneof") // special case
if oneof != "" {
// Oneof fields don't use the traditional protobuf tag.
@@ -715,9 +386,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
}
print("\n")
}
- if p.enc == nil && !strings.HasPrefix(f.Name, "XXX_") && oneof == "" {
- fmt.Fprintln(os.Stderr, "proto: no encoder for", f.Name, f.Type.String(), "[GetProperties]")
- }
}
// Re-order prop.order.
@@ -728,8 +396,7 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
}
if om, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
var oots []interface{}
- prop.oneofMarshaler, prop.oneofUnmarshaler, prop.oneofSizer, oots = om.XXX_OneofFuncs()
- prop.stype = t
+ _, _, _, oots = om.XXX_OneofFuncs()
// Interpret oneof metadata.
prop.OneofTypes = make(map[string]*OneofProperties)
@@ -779,30 +446,6 @@ func getPropertiesLocked(t reflect.Type) *StructProperties {
return prop
}
-// Return the Properties object for the x[0]'th field of the structure.
-func propByIndex(t reflect.Type, x []int) *Properties {
- if len(x) != 1 {
- fmt.Fprintf(os.Stderr, "proto: field index dimension %d (not 1) for type %s\n", len(x), t)
- return nil
- }
- prop := GetProperties(t)
- return prop.Prop[x[0]]
-}
-
-// Get the address and type of a pointer to a struct from an interface.
-func getbase(pb Message) (t reflect.Type, b structPointer, err error) {
- if pb == nil {
- err = ErrNil
- return
- }
- // get the reflect type of the pointer to the struct.
- t = reflect.TypeOf(pb)
- // get the address of the struct.
- value := reflect.ValueOf(pb)
- b = toStructPointer(value)
- return
-}
-
// A global registry of enum types.
// The generated code will register the generated maps by calling RegisterEnum.
@@ -826,20 +469,42 @@ func EnumValueMap(enumType string) map[string]int32 {
// A registry of all linked message types.
// The string is a fully-qualified proto name ("pkg.Message").
var (
- protoTypes = make(map[string]reflect.Type)
- revProtoTypes = make(map[reflect.Type]string)
+ protoTypedNils = make(map[string]Message) // a map from proto names to typed nil pointers
+ protoMapTypes = make(map[string]reflect.Type) // a map from proto names to map types
+ revProtoTypes = make(map[reflect.Type]string)
)
// RegisterType is called from generated code and maps from the fully qualified
// proto name to the type (pointer to struct) of the protocol buffer.
func RegisterType(x Message, name string) {
- if _, ok := protoTypes[name]; ok {
+ if _, ok := protoTypedNils[name]; ok {
// TODO: Some day, make this a panic.
log.Printf("proto: duplicate proto type registered: %s", name)
return
}
t := reflect.TypeOf(x)
- protoTypes[name] = t
+ if v := reflect.ValueOf(x); v.Kind() == reflect.Ptr && v.Pointer() == 0 {
+ // Generated code always calls RegisterType with nil x.
+ // This check is just for extra safety.
+ protoTypedNils[name] = x
+ } else {
+ protoTypedNils[name] = reflect.Zero(t).Interface().(Message)
+ }
+ revProtoTypes[t] = name
+}
+
+// RegisterMapType is called from generated code and maps from the fully qualified
+// proto name to the native map type of the proto map definition.
+func RegisterMapType(x interface{}, name string) {
+ if reflect.TypeOf(x).Kind() != reflect.Map {
+ panic(fmt.Sprintf("RegisterMapType(%T, %q); want map", x, name))
+ }
+ if _, ok := protoMapTypes[name]; ok {
+ log.Printf("proto: duplicate proto type registered: %s", name)
+ return
+ }
+ t := reflect.TypeOf(x)
+ protoMapTypes[name] = t
revProtoTypes[t] = name
}
@@ -855,7 +520,14 @@ func MessageName(x Message) string {
}
// MessageType returns the message type (pointer to struct) for a named message.
-func MessageType(name string) reflect.Type { return protoTypes[name] }
+// The type is not guaranteed to implement proto.Message if the name refers to a
+// map entry.
+func MessageType(name string) reflect.Type {
+ if t, ok := protoTypedNils[name]; ok {
+ return reflect.TypeOf(t)
+ }
+ return protoMapTypes[name]
+}
// A registry of all linked proto files.
var (
diff --git a/vendor/github.com/golang/protobuf/proto/table_marshal.go b/vendor/github.com/golang/protobuf/proto/table_marshal.go
new file mode 100644
index 000000000..0f212b302
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/proto/table_marshal.go
@@ -0,0 +1,2681 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2016 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package proto
+
+import (
+ "errors"
+ "fmt"
+ "math"
+ "reflect"
+ "sort"
+ "strconv"
+ "strings"
+ "sync"
+ "sync/atomic"
+ "unicode/utf8"
+)
+
+// a sizer takes a pointer to a field and the size of its tag, computes the size of
+// the encoded data.
+type sizer func(pointer, int) int
+
+// a marshaler takes a byte slice, a pointer to a field, and its tag (in wire format),
+// marshals the field to the end of the slice, returns the slice and error (if any).
+type marshaler func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error)
+
+// marshalInfo is the information used for marshaling a message.
+type marshalInfo struct {
+ typ reflect.Type
+ fields []*marshalFieldInfo
+ unrecognized field // offset of XXX_unrecognized
+ extensions field // offset of XXX_InternalExtensions
+ v1extensions field // offset of XXX_extensions
+ sizecache field // offset of XXX_sizecache
+ initialized int32 // 0 -- only typ is set, 1 -- fully initialized
+ messageset bool // uses message set wire format
+ hasmarshaler bool // has custom marshaler
+ sync.RWMutex // protect extElems map, also for initialization
+ extElems map[int32]*marshalElemInfo // info of extension elements
+}
+
+// marshalFieldInfo is the information used for marshaling a field of a message.
+type marshalFieldInfo struct {
+ field field
+ wiretag uint64 // tag in wire format
+ tagsize int // size of tag in wire format
+ sizer sizer
+ marshaler marshaler
+ isPointer bool
+ required bool // field is required
+ name string // name of the field, for error reporting
+ oneofElems map[reflect.Type]*marshalElemInfo // info of oneof elements
+}
+
+// marshalElemInfo is the information used for marshaling an extension or oneof element.
+type marshalElemInfo struct {
+ wiretag uint64 // tag in wire format
+ tagsize int // size of tag in wire format
+ sizer sizer
+ marshaler marshaler
+ isptr bool // elem is pointer typed, thus interface of this type is a direct interface (extension only)
+}
+
+var (
+ marshalInfoMap = map[reflect.Type]*marshalInfo{}
+ marshalInfoLock sync.Mutex
+)
+
+// getMarshalInfo returns the information to marshal a given type of message.
+// The info it returns may not necessarily initialized.
+// t is the type of the message (NOT the pointer to it).
+func getMarshalInfo(t reflect.Type) *marshalInfo {
+ marshalInfoLock.Lock()
+ u, ok := marshalInfoMap[t]
+ if !ok {
+ u = &marshalInfo{typ: t}
+ marshalInfoMap[t] = u
+ }
+ marshalInfoLock.Unlock()
+ return u
+}
+
+// Size is the entry point from generated code,
+// and should be ONLY called by generated code.
+// It computes the size of encoded data of msg.
+// a is a pointer to a place to store cached marshal info.
+func (a *InternalMessageInfo) Size(msg Message) int {
+ u := getMessageMarshalInfo(msg, a)
+ ptr := toPointer(&msg)
+ if ptr.isNil() {
+ // We get here if msg is a typed nil ((*SomeMessage)(nil)),
+ // so it satisfies the interface, and msg == nil wouldn't
+ // catch it. We don't want crash in this case.
+ return 0
+ }
+ return u.size(ptr)
+}
+
+// Marshal is the entry point from generated code,
+// and should be ONLY called by generated code.
+// It marshals msg to the end of b.
+// a is a pointer to a place to store cached marshal info.
+func (a *InternalMessageInfo) Marshal(b []byte, msg Message, deterministic bool) ([]byte, error) {
+ u := getMessageMarshalInfo(msg, a)
+ ptr := toPointer(&msg)
+ if ptr.isNil() {
+ // We get here if msg is a typed nil ((*SomeMessage)(nil)),
+ // so it satisfies the interface, and msg == nil wouldn't
+ // catch it. We don't want crash in this case.
+ return b, ErrNil
+ }
+ return u.marshal(b, ptr, deterministic)
+}
+
+func getMessageMarshalInfo(msg interface{}, a *InternalMessageInfo) *marshalInfo {
+ // u := a.marshal, but atomically.
+ // We use an atomic here to ensure memory consistency.
+ u := atomicLoadMarshalInfo(&a.marshal)
+ if u == nil {
+ // Get marshal information from type of message.
+ t := reflect.ValueOf(msg).Type()
+ if t.Kind() != reflect.Ptr {
+ panic(fmt.Sprintf("cannot handle non-pointer message type %v", t))
+ }
+ u = getMarshalInfo(t.Elem())
+ // Store it in the cache for later users.
+ // a.marshal = u, but atomically.
+ atomicStoreMarshalInfo(&a.marshal, u)
+ }
+ return u
+}
+
+// size is the main function to compute the size of the encoded data of a message.
+// ptr is the pointer to the message.
+func (u *marshalInfo) size(ptr pointer) int {
+ if atomic.LoadInt32(&u.initialized) == 0 {
+ u.computeMarshalInfo()
+ }
+
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ if u.hasmarshaler {
+ m := ptr.asPointerTo(u.typ).Interface().(Marshaler)
+ b, _ := m.Marshal()
+ return len(b)
+ }
+
+ n := 0
+ for _, f := range u.fields {
+ if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
+ // nil pointer always marshals to nothing
+ continue
+ }
+ n += f.sizer(ptr.offset(f.field), f.tagsize)
+ }
+ if u.extensions.IsValid() {
+ e := ptr.offset(u.extensions).toExtensions()
+ if u.messageset {
+ n += u.sizeMessageSet(e)
+ } else {
+ n += u.sizeExtensions(e)
+ }
+ }
+ if u.v1extensions.IsValid() {
+ m := *ptr.offset(u.v1extensions).toOldExtensions()
+ n += u.sizeV1Extensions(m)
+ }
+ if u.unrecognized.IsValid() {
+ s := *ptr.offset(u.unrecognized).toBytes()
+ n += len(s)
+ }
+ // cache the result for use in marshal
+ if u.sizecache.IsValid() {
+ atomic.StoreInt32(ptr.offset(u.sizecache).toInt32(), int32(n))
+ }
+ return n
+}
+
+// cachedsize gets the size from cache. If there is no cache (i.e. message is not generated),
+// fall back to compute the size.
+func (u *marshalInfo) cachedsize(ptr pointer) int {
+ if u.sizecache.IsValid() {
+ return int(atomic.LoadInt32(ptr.offset(u.sizecache).toInt32()))
+ }
+ return u.size(ptr)
+}
+
+// marshal is the main function to marshal a message. It takes a byte slice and appends
+// the encoded data to the end of the slice, returns the slice and error (if any).
+// ptr is the pointer to the message.
+// If deterministic is true, map is marshaled in deterministic order.
+func (u *marshalInfo) marshal(b []byte, ptr pointer, deterministic bool) ([]byte, error) {
+ if atomic.LoadInt32(&u.initialized) == 0 {
+ u.computeMarshalInfo()
+ }
+
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ if u.hasmarshaler {
+ m := ptr.asPointerTo(u.typ).Interface().(Marshaler)
+ b1, err := m.Marshal()
+ b = append(b, b1...)
+ return b, err
+ }
+
+ var err, errreq error
+ // The old marshaler encodes extensions at beginning.
+ if u.extensions.IsValid() {
+ e := ptr.offset(u.extensions).toExtensions()
+ if u.messageset {
+ b, err = u.appendMessageSet(b, e, deterministic)
+ } else {
+ b, err = u.appendExtensions(b, e, deterministic)
+ }
+ if err != nil {
+ return b, err
+ }
+ }
+ if u.v1extensions.IsValid() {
+ m := *ptr.offset(u.v1extensions).toOldExtensions()
+ b, err = u.appendV1Extensions(b, m, deterministic)
+ if err != nil {
+ return b, err
+ }
+ }
+ for _, f := range u.fields {
+ if f.required && errreq == nil {
+ if ptr.offset(f.field).getPointer().isNil() {
+ // Required field is not set.
+ // We record the error but keep going, to give a complete marshaling.
+ errreq = &RequiredNotSetError{f.name}
+ continue
+ }
+ }
+ if f.isPointer && ptr.offset(f.field).getPointer().isNil() {
+ // nil pointer always marshals to nothing
+ continue
+ }
+ b, err = f.marshaler(b, ptr.offset(f.field), f.wiretag, deterministic)
+ if err != nil {
+ if err1, ok := err.(*RequiredNotSetError); ok {
+ // Required field in submessage is not set.
+ // We record the error but keep going, to give a complete marshaling.
+ if errreq == nil {
+ errreq = &RequiredNotSetError{f.name + "." + err1.field}
+ }
+ continue
+ }
+ if err == errRepeatedHasNil {
+ err = errors.New("proto: repeated field " + f.name + " has nil element")
+ }
+ return b, err
+ }
+ }
+ if u.unrecognized.IsValid() {
+ s := *ptr.offset(u.unrecognized).toBytes()
+ b = append(b, s...)
+ }
+ return b, errreq
+}
+
+// computeMarshalInfo initializes the marshal info.
+func (u *marshalInfo) computeMarshalInfo() {
+ u.Lock()
+ defer u.Unlock()
+ if u.initialized != 0 { // non-atomic read is ok as it is protected by the lock
+ return
+ }
+
+ t := u.typ
+ u.unrecognized = invalidField
+ u.extensions = invalidField
+ u.v1extensions = invalidField
+ u.sizecache = invalidField
+
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ if reflect.PtrTo(t).Implements(marshalerType) {
+ u.hasmarshaler = true
+ atomic.StoreInt32(&u.initialized, 1)
+ return
+ }
+
+ // get oneof implementers
+ var oneofImplementers []interface{}
+ if m, ok := reflect.Zero(reflect.PtrTo(t)).Interface().(oneofMessage); ok {
+ _, _, _, oneofImplementers = m.XXX_OneofFuncs()
+ }
+
+ n := t.NumField()
+
+ // deal with XXX fields first
+ for i := 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+ if !strings.HasPrefix(f.Name, "XXX_") {
+ continue
+ }
+ switch f.Name {
+ case "XXX_sizecache":
+ u.sizecache = toField(&f)
+ case "XXX_unrecognized":
+ u.unrecognized = toField(&f)
+ case "XXX_InternalExtensions":
+ u.extensions = toField(&f)
+ u.messageset = f.Tag.Get("protobuf_messageset") == "1"
+ case "XXX_extensions":
+ u.v1extensions = toField(&f)
+ case "XXX_NoUnkeyedLiteral":
+ // nothing to do
+ default:
+ panic("unknown XXX field: " + f.Name)
+ }
+ n--
+ }
+
+ // normal fields
+ fields := make([]marshalFieldInfo, n) // batch allocation
+ u.fields = make([]*marshalFieldInfo, 0, n)
+ for i, j := 0, 0; i < t.NumField(); i++ {
+ f := t.Field(i)
+
+ if strings.HasPrefix(f.Name, "XXX_") {
+ continue
+ }
+ field := &fields[j]
+ j++
+ field.name = f.Name
+ u.fields = append(u.fields, field)
+ if f.Tag.Get("protobuf_oneof") != "" {
+ field.computeOneofFieldInfo(&f, oneofImplementers)
+ continue
+ }
+ if f.Tag.Get("protobuf") == "" {
+ // field has no tag (not in generated message), ignore it
+ u.fields = u.fields[:len(u.fields)-1]
+ j--
+ continue
+ }
+ field.computeMarshalFieldInfo(&f)
+ }
+
+ // fields are marshaled in tag order on the wire.
+ sort.Sort(byTag(u.fields))
+
+ atomic.StoreInt32(&u.initialized, 1)
+}
+
+// helper for sorting fields by tag
+type byTag []*marshalFieldInfo
+
+func (a byTag) Len() int { return len(a) }
+func (a byTag) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a byTag) Less(i, j int) bool { return a[i].wiretag < a[j].wiretag }
+
+// getExtElemInfo returns the information to marshal an extension element.
+// The info it returns is initialized.
+func (u *marshalInfo) getExtElemInfo(desc *ExtensionDesc) *marshalElemInfo {
+ // get from cache first
+ u.RLock()
+ e, ok := u.extElems[desc.Field]
+ u.RUnlock()
+ if ok {
+ return e
+ }
+
+ t := reflect.TypeOf(desc.ExtensionType) // pointer or slice to basic type or struct
+ tags := strings.Split(desc.Tag, ",")
+ tag, err := strconv.Atoi(tags[1])
+ if err != nil {
+ panic("tag is not an integer")
+ }
+ wt := wiretype(tags[0])
+ sizer, marshaler := typeMarshaler(t, tags, false, false)
+ e = &marshalElemInfo{
+ wiretag: uint64(tag)<<3 | wt,
+ tagsize: SizeVarint(uint64(tag) << 3),
+ sizer: sizer,
+ marshaler: marshaler,
+ isptr: t.Kind() == reflect.Ptr,
+ }
+
+ // update cache
+ u.Lock()
+ if u.extElems == nil {
+ u.extElems = make(map[int32]*marshalElemInfo)
+ }
+ u.extElems[desc.Field] = e
+ u.Unlock()
+ return e
+}
+
+// computeMarshalFieldInfo fills up the information to marshal a field.
+func (fi *marshalFieldInfo) computeMarshalFieldInfo(f *reflect.StructField) {
+ // parse protobuf tag of the field.
+ // tag has format of "bytes,49,opt,name=foo,def=hello!"
+ tags := strings.Split(f.Tag.Get("protobuf"), ",")
+ if tags[0] == "" {
+ return
+ }
+ tag, err := strconv.Atoi(tags[1])
+ if err != nil {
+ panic("tag is not an integer")
+ }
+ wt := wiretype(tags[0])
+ if tags[2] == "req" {
+ fi.required = true
+ }
+ fi.setTag(f, tag, wt)
+ fi.setMarshaler(f, tags)
+}
+
+func (fi *marshalFieldInfo) computeOneofFieldInfo(f *reflect.StructField, oneofImplementers []interface{}) {
+ fi.field = toField(f)
+ fi.wiretag = 1<<31 - 1 // Use a large tag number, make oneofs sorted at the end. This tag will not appear on the wire.
+ fi.isPointer = true
+ fi.sizer, fi.marshaler = makeOneOfMarshaler(fi, f)
+ fi.oneofElems = make(map[reflect.Type]*marshalElemInfo)
+
+ ityp := f.Type // interface type
+ for _, o := range oneofImplementers {
+ t := reflect.TypeOf(o)
+ if !t.Implements(ityp) {
+ continue
+ }
+ sf := t.Elem().Field(0) // oneof implementer is a struct with a single field
+ tags := strings.Split(sf.Tag.Get("protobuf"), ",")
+ tag, err := strconv.Atoi(tags[1])
+ if err != nil {
+ panic("tag is not an integer")
+ }
+ wt := wiretype(tags[0])
+ sizer, marshaler := typeMarshaler(sf.Type, tags, false, true) // oneof should not omit any zero value
+ fi.oneofElems[t.Elem()] = &marshalElemInfo{
+ wiretag: uint64(tag)<<3 | wt,
+ tagsize: SizeVarint(uint64(tag) << 3),
+ sizer: sizer,
+ marshaler: marshaler,
+ }
+ }
+}
+
+type oneofMessage interface {
+ XXX_OneofFuncs() (func(Message, *Buffer) error, func(Message, int, int, *Buffer) (bool, error), func(Message) int, []interface{})
+}
+
+// wiretype returns the wire encoding of the type.
+func wiretype(encoding string) uint64 {
+ switch encoding {
+ case "fixed32":
+ return WireFixed32
+ case "fixed64":
+ return WireFixed64
+ case "varint", "zigzag32", "zigzag64":
+ return WireVarint
+ case "bytes":
+ return WireBytes
+ case "group":
+ return WireStartGroup
+ }
+ panic("unknown wire type " + encoding)
+}
+
+// setTag fills up the tag (in wire format) and its size in the info of a field.
+func (fi *marshalFieldInfo) setTag(f *reflect.StructField, tag int, wt uint64) {
+ fi.field = toField(f)
+ fi.wiretag = uint64(tag)<<3 | wt
+ fi.tagsize = SizeVarint(uint64(tag) << 3)
+}
+
+// setMarshaler fills up the sizer and marshaler in the info of a field.
+func (fi *marshalFieldInfo) setMarshaler(f *reflect.StructField, tags []string) {
+ switch f.Type.Kind() {
+ case reflect.Map:
+ // map field
+ fi.isPointer = true
+ fi.sizer, fi.marshaler = makeMapMarshaler(f)
+ return
+ case reflect.Ptr, reflect.Slice:
+ fi.isPointer = true
+ }
+ fi.sizer, fi.marshaler = typeMarshaler(f.Type, tags, true, false)
+}
+
+// typeMarshaler returns the sizer and marshaler of a given field.
+// t is the type of the field.
+// tags is the generated "protobuf" tag of the field.
+// If nozero is true, zero value is not marshaled to the wire.
+// If oneof is true, it is a oneof field.
+func typeMarshaler(t reflect.Type, tags []string, nozero, oneof bool) (sizer, marshaler) {
+ encoding := tags[0]
+
+ pointer := false
+ slice := false
+ if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
+ slice = true
+ t = t.Elem()
+ }
+ if t.Kind() == reflect.Ptr {
+ pointer = true
+ t = t.Elem()
+ }
+
+ packed := false
+ proto3 := false
+ for i := 2; i < len(tags); i++ {
+ if tags[i] == "packed" {
+ packed = true
+ }
+ if tags[i] == "proto3" {
+ proto3 = true
+ }
+ }
+
+ switch t.Kind() {
+ case reflect.Bool:
+ if pointer {
+ return sizeBoolPtr, appendBoolPtr
+ }
+ if slice {
+ if packed {
+ return sizeBoolPackedSlice, appendBoolPackedSlice
+ }
+ return sizeBoolSlice, appendBoolSlice
+ }
+ if nozero {
+ return sizeBoolValueNoZero, appendBoolValueNoZero
+ }
+ return sizeBoolValue, appendBoolValue
+ case reflect.Uint32:
+ switch encoding {
+ case "fixed32":
+ if pointer {
+ return sizeFixed32Ptr, appendFixed32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFixed32PackedSlice, appendFixed32PackedSlice
+ }
+ return sizeFixed32Slice, appendFixed32Slice
+ }
+ if nozero {
+ return sizeFixed32ValueNoZero, appendFixed32ValueNoZero
+ }
+ return sizeFixed32Value, appendFixed32Value
+ case "varint":
+ if pointer {
+ return sizeVarint32Ptr, appendVarint32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeVarint32PackedSlice, appendVarint32PackedSlice
+ }
+ return sizeVarint32Slice, appendVarint32Slice
+ }
+ if nozero {
+ return sizeVarint32ValueNoZero, appendVarint32ValueNoZero
+ }
+ return sizeVarint32Value, appendVarint32Value
+ }
+ case reflect.Int32:
+ switch encoding {
+ case "fixed32":
+ if pointer {
+ return sizeFixedS32Ptr, appendFixedS32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFixedS32PackedSlice, appendFixedS32PackedSlice
+ }
+ return sizeFixedS32Slice, appendFixedS32Slice
+ }
+ if nozero {
+ return sizeFixedS32ValueNoZero, appendFixedS32ValueNoZero
+ }
+ return sizeFixedS32Value, appendFixedS32Value
+ case "varint":
+ if pointer {
+ return sizeVarintS32Ptr, appendVarintS32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeVarintS32PackedSlice, appendVarintS32PackedSlice
+ }
+ return sizeVarintS32Slice, appendVarintS32Slice
+ }
+ if nozero {
+ return sizeVarintS32ValueNoZero, appendVarintS32ValueNoZero
+ }
+ return sizeVarintS32Value, appendVarintS32Value
+ case "zigzag32":
+ if pointer {
+ return sizeZigzag32Ptr, appendZigzag32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeZigzag32PackedSlice, appendZigzag32PackedSlice
+ }
+ return sizeZigzag32Slice, appendZigzag32Slice
+ }
+ if nozero {
+ return sizeZigzag32ValueNoZero, appendZigzag32ValueNoZero
+ }
+ return sizeZigzag32Value, appendZigzag32Value
+ }
+ case reflect.Uint64:
+ switch encoding {
+ case "fixed64":
+ if pointer {
+ return sizeFixed64Ptr, appendFixed64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFixed64PackedSlice, appendFixed64PackedSlice
+ }
+ return sizeFixed64Slice, appendFixed64Slice
+ }
+ if nozero {
+ return sizeFixed64ValueNoZero, appendFixed64ValueNoZero
+ }
+ return sizeFixed64Value, appendFixed64Value
+ case "varint":
+ if pointer {
+ return sizeVarint64Ptr, appendVarint64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeVarint64PackedSlice, appendVarint64PackedSlice
+ }
+ return sizeVarint64Slice, appendVarint64Slice
+ }
+ if nozero {
+ return sizeVarint64ValueNoZero, appendVarint64ValueNoZero
+ }
+ return sizeVarint64Value, appendVarint64Value
+ }
+ case reflect.Int64:
+ switch encoding {
+ case "fixed64":
+ if pointer {
+ return sizeFixedS64Ptr, appendFixedS64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFixedS64PackedSlice, appendFixedS64PackedSlice
+ }
+ return sizeFixedS64Slice, appendFixedS64Slice
+ }
+ if nozero {
+ return sizeFixedS64ValueNoZero, appendFixedS64ValueNoZero
+ }
+ return sizeFixedS64Value, appendFixedS64Value
+ case "varint":
+ if pointer {
+ return sizeVarintS64Ptr, appendVarintS64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeVarintS64PackedSlice, appendVarintS64PackedSlice
+ }
+ return sizeVarintS64Slice, appendVarintS64Slice
+ }
+ if nozero {
+ return sizeVarintS64ValueNoZero, appendVarintS64ValueNoZero
+ }
+ return sizeVarintS64Value, appendVarintS64Value
+ case "zigzag64":
+ if pointer {
+ return sizeZigzag64Ptr, appendZigzag64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeZigzag64PackedSlice, appendZigzag64PackedSlice
+ }
+ return sizeZigzag64Slice, appendZigzag64Slice
+ }
+ if nozero {
+ return sizeZigzag64ValueNoZero, appendZigzag64ValueNoZero
+ }
+ return sizeZigzag64Value, appendZigzag64Value
+ }
+ case reflect.Float32:
+ if pointer {
+ return sizeFloat32Ptr, appendFloat32Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFloat32PackedSlice, appendFloat32PackedSlice
+ }
+ return sizeFloat32Slice, appendFloat32Slice
+ }
+ if nozero {
+ return sizeFloat32ValueNoZero, appendFloat32ValueNoZero
+ }
+ return sizeFloat32Value, appendFloat32Value
+ case reflect.Float64:
+ if pointer {
+ return sizeFloat64Ptr, appendFloat64Ptr
+ }
+ if slice {
+ if packed {
+ return sizeFloat64PackedSlice, appendFloat64PackedSlice
+ }
+ return sizeFloat64Slice, appendFloat64Slice
+ }
+ if nozero {
+ return sizeFloat64ValueNoZero, appendFloat64ValueNoZero
+ }
+ return sizeFloat64Value, appendFloat64Value
+ case reflect.String:
+ if pointer {
+ return sizeStringPtr, appendStringPtr
+ }
+ if slice {
+ return sizeStringSlice, appendStringSlice
+ }
+ if nozero {
+ return sizeStringValueNoZero, appendStringValueNoZero
+ }
+ return sizeStringValue, appendStringValue
+ case reflect.Slice:
+ if slice {
+ return sizeBytesSlice, appendBytesSlice
+ }
+ if oneof {
+ // Oneof bytes field may also have "proto3" tag.
+ // We want to marshal it as a oneof field. Do this
+ // check before the proto3 check.
+ return sizeBytesOneof, appendBytesOneof
+ }
+ if proto3 {
+ return sizeBytes3, appendBytes3
+ }
+ return sizeBytes, appendBytes
+ case reflect.Struct:
+ switch encoding {
+ case "group":
+ if slice {
+ return makeGroupSliceMarshaler(getMarshalInfo(t))
+ }
+ return makeGroupMarshaler(getMarshalInfo(t))
+ case "bytes":
+ if slice {
+ return makeMessageSliceMarshaler(getMarshalInfo(t))
+ }
+ return makeMessageMarshaler(getMarshalInfo(t))
+ }
+ }
+ panic(fmt.Sprintf("unknown or mismatched type: type: %v, wire type: %v", t, encoding))
+}
+
+// Below are functions to size/marshal a specific type of a field.
+// They are stored in the field's info, and called by function pointers.
+// They have type sizer or marshaler.
+
+func sizeFixed32Value(_ pointer, tagsize int) int {
+ return 4 + tagsize
+}
+func sizeFixed32ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toUint32()
+ if v == 0 {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFixed32Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toUint32Ptr()
+ if p == nil {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFixed32Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint32Slice()
+ return (4 + tagsize) * len(s)
+}
+func sizeFixed32PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
+}
+func sizeFixedS32Value(_ pointer, tagsize int) int {
+ return 4 + tagsize
+}
+func sizeFixedS32ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFixedS32Ptr(ptr pointer, tagsize int) int {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFixedS32Slice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ return (4 + tagsize) * len(s)
+}
+func sizeFixedS32PackedSlice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
+}
+func sizeFloat32Value(_ pointer, tagsize int) int {
+ return 4 + tagsize
+}
+func sizeFloat32ValueNoZero(ptr pointer, tagsize int) int {
+ v := math.Float32bits(*ptr.toFloat32())
+ if v == 0 {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFloat32Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toFloat32Ptr()
+ if p == nil {
+ return 0
+ }
+ return 4 + tagsize
+}
+func sizeFloat32Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toFloat32Slice()
+ return (4 + tagsize) * len(s)
+}
+func sizeFloat32PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toFloat32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 4*len(s) + SizeVarint(uint64(4*len(s))) + tagsize
+}
+func sizeFixed64Value(_ pointer, tagsize int) int {
+ return 8 + tagsize
+}
+func sizeFixed64ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toUint64()
+ if v == 0 {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFixed64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toUint64Ptr()
+ if p == nil {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFixed64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint64Slice()
+ return (8 + tagsize) * len(s)
+}
+func sizeFixed64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
+}
+func sizeFixedS64Value(_ pointer, tagsize int) int {
+ return 8 + tagsize
+}
+func sizeFixedS64ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFixedS64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFixedS64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ return (8 + tagsize) * len(s)
+}
+func sizeFixedS64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
+}
+func sizeFloat64Value(_ pointer, tagsize int) int {
+ return 8 + tagsize
+}
+func sizeFloat64ValueNoZero(ptr pointer, tagsize int) int {
+ v := math.Float64bits(*ptr.toFloat64())
+ if v == 0 {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFloat64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toFloat64Ptr()
+ if p == nil {
+ return 0
+ }
+ return 8 + tagsize
+}
+func sizeFloat64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toFloat64Slice()
+ return (8 + tagsize) * len(s)
+}
+func sizeFloat64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toFloat64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ return 8*len(s) + SizeVarint(uint64(8*len(s))) + tagsize
+}
+func sizeVarint32Value(ptr pointer, tagsize int) int {
+ v := *ptr.toUint32()
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarint32ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toUint32()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarint32Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toUint32Ptr()
+ if p == nil {
+ return 0
+ }
+ return SizeVarint(uint64(*p)) + tagsize
+}
+func sizeVarint32Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint32Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v)) + tagsize
+ }
+ return n
+}
+func sizeVarint32PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeVarintS32Value(ptr pointer, tagsize int) int {
+ v := *ptr.toInt32()
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarintS32ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarintS32Ptr(ptr pointer, tagsize int) int {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return 0
+ }
+ return SizeVarint(uint64(*p)) + tagsize
+}
+func sizeVarintS32Slice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v)) + tagsize
+ }
+ return n
+}
+func sizeVarintS32PackedSlice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeVarint64Value(ptr pointer, tagsize int) int {
+ v := *ptr.toUint64()
+ return SizeVarint(v) + tagsize
+}
+func sizeVarint64ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toUint64()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(v) + tagsize
+}
+func sizeVarint64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toUint64Ptr()
+ if p == nil {
+ return 0
+ }
+ return SizeVarint(*p) + tagsize
+}
+func sizeVarint64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint64Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(v) + tagsize
+ }
+ return n
+}
+func sizeVarint64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toUint64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(v)
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeVarintS64Value(ptr pointer, tagsize int) int {
+ v := *ptr.toInt64()
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarintS64ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(uint64(v)) + tagsize
+}
+func sizeVarintS64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return 0
+ }
+ return SizeVarint(uint64(*p)) + tagsize
+}
+func sizeVarintS64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v)) + tagsize
+ }
+ return n
+}
+func sizeVarintS64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeZigzag32Value(ptr pointer, tagsize int) int {
+ v := *ptr.toInt32()
+ return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
+}
+func sizeZigzag32ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
+}
+func sizeZigzag32Ptr(ptr pointer, tagsize int) int {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return 0
+ }
+ v := *p
+ return SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
+}
+func sizeZigzag32Slice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64((uint32(v)<<1)^uint32((int32(v)>>31)))) + tagsize
+ }
+ return n
+}
+func sizeZigzag32PackedSlice(ptr pointer, tagsize int) int {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31))))
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeZigzag64Value(ptr pointer, tagsize int) int {
+ v := *ptr.toInt64()
+ return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
+}
+func sizeZigzag64ValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return 0
+ }
+ return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
+}
+func sizeZigzag64Ptr(ptr pointer, tagsize int) int {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return 0
+ }
+ v := *p
+ return SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
+}
+func sizeZigzag64Slice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v<<1)^uint64((int64(v)>>63))) + tagsize
+ }
+ return n
+}
+func sizeZigzag64PackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return 0
+ }
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63)))
+ }
+ return n + SizeVarint(uint64(n)) + tagsize
+}
+func sizeBoolValue(_ pointer, tagsize int) int {
+ return 1 + tagsize
+}
+func sizeBoolValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toBool()
+ if !v {
+ return 0
+ }
+ return 1 + tagsize
+}
+func sizeBoolPtr(ptr pointer, tagsize int) int {
+ p := *ptr.toBoolPtr()
+ if p == nil {
+ return 0
+ }
+ return 1 + tagsize
+}
+func sizeBoolSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toBoolSlice()
+ return (1 + tagsize) * len(s)
+}
+func sizeBoolPackedSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toBoolSlice()
+ if len(s) == 0 {
+ return 0
+ }
+ return len(s) + SizeVarint(uint64(len(s))) + tagsize
+}
+func sizeStringValue(ptr pointer, tagsize int) int {
+ v := *ptr.toString()
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeStringValueNoZero(ptr pointer, tagsize int) int {
+ v := *ptr.toString()
+ if v == "" {
+ return 0
+ }
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeStringPtr(ptr pointer, tagsize int) int {
+ p := *ptr.toStringPtr()
+ if p == nil {
+ return 0
+ }
+ v := *p
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeStringSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toStringSlice()
+ n := 0
+ for _, v := range s {
+ n += len(v) + SizeVarint(uint64(len(v))) + tagsize
+ }
+ return n
+}
+func sizeBytes(ptr pointer, tagsize int) int {
+ v := *ptr.toBytes()
+ if v == nil {
+ return 0
+ }
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeBytes3(ptr pointer, tagsize int) int {
+ v := *ptr.toBytes()
+ if len(v) == 0 {
+ return 0
+ }
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeBytesOneof(ptr pointer, tagsize int) int {
+ v := *ptr.toBytes()
+ return len(v) + SizeVarint(uint64(len(v))) + tagsize
+}
+func sizeBytesSlice(ptr pointer, tagsize int) int {
+ s := *ptr.toBytesSlice()
+ n := 0
+ for _, v := range s {
+ n += len(v) + SizeVarint(uint64(len(v))) + tagsize
+ }
+ return n
+}
+
+// appendFixed32 appends an encoded fixed32 to b.
+func appendFixed32(b []byte, v uint32) []byte {
+ b = append(b,
+ byte(v),
+ byte(v>>8),
+ byte(v>>16),
+ byte(v>>24))
+ return b
+}
+
+// appendFixed64 appends an encoded fixed64 to b.
+func appendFixed64(b []byte, v uint64) []byte {
+ b = append(b,
+ byte(v),
+ byte(v>>8),
+ byte(v>>16),
+ byte(v>>24),
+ byte(v>>32),
+ byte(v>>40),
+ byte(v>>48),
+ byte(v>>56))
+ return b
+}
+
+// appendVarint appends an encoded varint to b.
+func appendVarint(b []byte, v uint64) []byte {
+ // TODO: make 1-byte (maybe 2-byte) case inline-able, once we
+ // have non-leaf inliner.
+ switch {
+ case v < 1<<7:
+ b = append(b, byte(v))
+ case v < 1<<14:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte(v>>7))
+ case v < 1<<21:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte(v>>14))
+ case v < 1<<28:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte(v>>21))
+ case v < 1<<35:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte(v>>28))
+ case v < 1<<42:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte((v>>28)&0x7f|0x80),
+ byte(v>>35))
+ case v < 1<<49:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte((v>>28)&0x7f|0x80),
+ byte((v>>35)&0x7f|0x80),
+ byte(v>>42))
+ case v < 1<<56:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte((v>>28)&0x7f|0x80),
+ byte((v>>35)&0x7f|0x80),
+ byte((v>>42)&0x7f|0x80),
+ byte(v>>49))
+ case v < 1<<63:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte((v>>28)&0x7f|0x80),
+ byte((v>>35)&0x7f|0x80),
+ byte((v>>42)&0x7f|0x80),
+ byte((v>>49)&0x7f|0x80),
+ byte(v>>56))
+ default:
+ b = append(b,
+ byte(v&0x7f|0x80),
+ byte((v>>7)&0x7f|0x80),
+ byte((v>>14)&0x7f|0x80),
+ byte((v>>21)&0x7f|0x80),
+ byte((v>>28)&0x7f|0x80),
+ byte((v>>35)&0x7f|0x80),
+ byte((v>>42)&0x7f|0x80),
+ byte((v>>49)&0x7f|0x80),
+ byte((v>>56)&0x7f|0x80),
+ 1)
+ }
+ return b
+}
+
+func appendFixed32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint32()
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, v)
+ return b, nil
+}
+func appendFixed32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint32()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, v)
+ return b, nil
+}
+func appendFixed32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toUint32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, *p)
+ return b, nil
+}
+func appendFixed32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, v)
+ }
+ return b, nil
+}
+func appendFixed32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(4*len(s)))
+ for _, v := range s {
+ b = appendFixed32(b, v)
+ }
+ return b, nil
+}
+func appendFixedS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, uint32(v))
+ return b, nil
+}
+func appendFixedS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, uint32(v))
+ return b, nil
+}
+func appendFixedS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, uint32(*p))
+ return b, nil
+}
+func appendFixedS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, uint32(v))
+ }
+ return b, nil
+}
+func appendFixedS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(4*len(s)))
+ for _, v := range s {
+ b = appendFixed32(b, uint32(v))
+ }
+ return b, nil
+}
+func appendFloat32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := math.Float32bits(*ptr.toFloat32())
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, v)
+ return b, nil
+}
+func appendFloat32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := math.Float32bits(*ptr.toFloat32())
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, v)
+ return b, nil
+}
+func appendFloat32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toFloat32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, math.Float32bits(*p))
+ return b, nil
+}
+func appendFloat32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toFloat32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed32(b, math.Float32bits(v))
+ }
+ return b, nil
+}
+func appendFloat32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toFloat32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(4*len(s)))
+ for _, v := range s {
+ b = appendFixed32(b, math.Float32bits(v))
+ }
+ return b, nil
+}
+func appendFixed64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint64()
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, v)
+ return b, nil
+}
+func appendFixed64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint64()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, v)
+ return b, nil
+}
+func appendFixed64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toUint64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, *p)
+ return b, nil
+}
+func appendFixed64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, v)
+ }
+ return b, nil
+}
+func appendFixed64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(8*len(s)))
+ for _, v := range s {
+ b = appendFixed64(b, v)
+ }
+ return b, nil
+}
+func appendFixedS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, uint64(v))
+ return b, nil
+}
+func appendFixedS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, uint64(v))
+ return b, nil
+}
+func appendFixedS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, uint64(*p))
+ return b, nil
+}
+func appendFixedS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, uint64(v))
+ }
+ return b, nil
+}
+func appendFixedS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(8*len(s)))
+ for _, v := range s {
+ b = appendFixed64(b, uint64(v))
+ }
+ return b, nil
+}
+func appendFloat64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := math.Float64bits(*ptr.toFloat64())
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, v)
+ return b, nil
+}
+func appendFloat64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := math.Float64bits(*ptr.toFloat64())
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, v)
+ return b, nil
+}
+func appendFloat64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toFloat64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, math.Float64bits(*p))
+ return b, nil
+}
+func appendFloat64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toFloat64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendFixed64(b, math.Float64bits(v))
+ }
+ return b, nil
+}
+func appendFloat64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toFloat64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(8*len(s)))
+ for _, v := range s {
+ b = appendFixed64(b, math.Float64bits(v))
+ }
+ return b, nil
+}
+func appendVarint32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint32()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarint32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint32()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarint32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toUint32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(*p))
+ return b, nil
+}
+func appendVarint32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendVarint32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendVarintS32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarintS32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarintS32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(*p))
+ return b, nil
+}
+func appendVarintS32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendVarintS32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendVarint64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint64()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, v)
+ return b, nil
+}
+func appendVarint64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toUint64()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, v)
+ return b, nil
+}
+func appendVarint64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toUint64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, *p)
+ return b, nil
+}
+func appendVarint64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, v)
+ }
+ return b, nil
+}
+func appendVarint64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toUint64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(v)
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, v)
+ }
+ return b, nil
+}
+func appendVarintS64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarintS64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ return b, nil
+}
+func appendVarintS64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(*p))
+ return b, nil
+}
+func appendVarintS64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendVarintS64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v))
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, uint64(v))
+ }
+ return b, nil
+}
+func appendZigzag32Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
+ return b, nil
+}
+func appendZigzag32ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt32()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
+ return b, nil
+}
+func appendZigzag32Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := ptr.getInt32Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ v := *p
+ b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
+ return b, nil
+}
+func appendZigzag32Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
+ }
+ return b, nil
+}
+func appendZigzag32PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := ptr.getInt32Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64((uint32(v) << 1) ^ uint32((int32(v) >> 31))))
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, uint64((uint32(v)<<1)^uint32((int32(v)>>31))))
+ }
+ return b, nil
+}
+func appendZigzag64Value(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
+ return b, nil
+}
+func appendZigzag64ValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toInt64()
+ if v == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
+ return b, nil
+}
+func appendZigzag64Ptr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toInt64Ptr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ v := *p
+ b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
+ return b, nil
+}
+func appendZigzag64Slice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
+ }
+ return b, nil
+}
+func appendZigzag64PackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toInt64Slice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ // compute size
+ n := 0
+ for _, v := range s {
+ n += SizeVarint(uint64(v<<1) ^ uint64((int64(v) >> 63)))
+ }
+ b = appendVarint(b, uint64(n))
+ for _, v := range s {
+ b = appendVarint(b, uint64(v<<1)^uint64((int64(v)>>63)))
+ }
+ return b, nil
+}
+func appendBoolValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toBool()
+ b = appendVarint(b, wiretag)
+ if v {
+ b = append(b, 1)
+ } else {
+ b = append(b, 0)
+ }
+ return b, nil
+}
+func appendBoolValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toBool()
+ if !v {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = append(b, 1)
+ return b, nil
+}
+
+func appendBoolPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toBoolPtr()
+ if p == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ if *p {
+ b = append(b, 1)
+ } else {
+ b = append(b, 0)
+ }
+ return b, nil
+}
+func appendBoolSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toBoolSlice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ if v {
+ b = append(b, 1)
+ } else {
+ b = append(b, 0)
+ }
+ }
+ return b, nil
+}
+func appendBoolPackedSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toBoolSlice()
+ if len(s) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag&^7|WireBytes)
+ b = appendVarint(b, uint64(len(s)))
+ for _, v := range s {
+ if v {
+ b = append(b, 1)
+ } else {
+ b = append(b, 0)
+ }
+ }
+ return b, nil
+}
+func appendStringValue(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toString()
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendStringValueNoZero(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toString()
+ if v == "" {
+ return b, nil
+ }
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendStringPtr(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ p := *ptr.toStringPtr()
+ if p == nil {
+ return b, nil
+ }
+ v := *p
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendStringSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toStringSlice()
+ for _, v := range s {
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ }
+ return b, nil
+}
+func appendBytes(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toBytes()
+ if v == nil {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendBytes3(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toBytes()
+ if len(v) == 0 {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendBytesOneof(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ v := *ptr.toBytes()
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ return b, nil
+}
+func appendBytesSlice(b []byte, ptr pointer, wiretag uint64, _ bool) ([]byte, error) {
+ s := *ptr.toBytesSlice()
+ for _, v := range s {
+ b = appendVarint(b, wiretag)
+ b = appendVarint(b, uint64(len(v)))
+ b = append(b, v...)
+ }
+ return b, nil
+}
+
+// makeGroupMarshaler returns the sizer and marshaler for a group.
+// u is the marshal info of the underlying message.
+func makeGroupMarshaler(u *marshalInfo) (sizer, marshaler) {
+ return func(ptr pointer, tagsize int) int {
+ p := ptr.getPointer()
+ if p.isNil() {
+ return 0
+ }
+ return u.size(p) + 2*tagsize
+ },
+ func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
+ p := ptr.getPointer()
+ if p.isNil() {
+ return b, nil
+ }
+ var err error
+ b = appendVarint(b, wiretag) // start group
+ b, err = u.marshal(b, p, deterministic)
+ b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
+ return b, err
+ }
+}
+
+// makeGroupSliceMarshaler returns the sizer and marshaler for a group slice.
+// u is the marshal info of the underlying message.
+func makeGroupSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
+ return func(ptr pointer, tagsize int) int {
+ s := ptr.getPointerSlice()
+ n := 0
+ for _, v := range s {
+ if v.isNil() {
+ continue
+ }
+ n += u.size(v) + 2*tagsize
+ }
+ return n
+ },
+ func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
+ s := ptr.getPointerSlice()
+ var err, errreq error
+ for _, v := range s {
+ if v.isNil() {
+ return b, errRepeatedHasNil
+ }
+ b = appendVarint(b, wiretag) // start group
+ b, err = u.marshal(b, v, deterministic)
+ b = appendVarint(b, wiretag+(WireEndGroup-WireStartGroup)) // end group
+ if err != nil {
+ if _, ok := err.(*RequiredNotSetError); ok {
+ // Required field in submessage is not set.
+ // We record the error but keep going, to give a complete marshaling.
+ if errreq == nil {
+ errreq = err
+ }
+ continue
+ }
+ if err == ErrNil {
+ err = errRepeatedHasNil
+ }
+ return b, err
+ }
+ }
+ return b, errreq
+ }
+}
+
+// makeMessageMarshaler returns the sizer and marshaler for a message field.
+// u is the marshal info of the message.
+func makeMessageMarshaler(u *marshalInfo) (sizer, marshaler) {
+ return func(ptr pointer, tagsize int) int {
+ p := ptr.getPointer()
+ if p.isNil() {
+ return 0
+ }
+ siz := u.size(p)
+ return siz + SizeVarint(uint64(siz)) + tagsize
+ },
+ func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
+ p := ptr.getPointer()
+ if p.isNil() {
+ return b, nil
+ }
+ b = appendVarint(b, wiretag)
+ siz := u.cachedsize(p)
+ b = appendVarint(b, uint64(siz))
+ return u.marshal(b, p, deterministic)
+ }
+}
+
+// makeMessageSliceMarshaler returns the sizer and marshaler for a message slice.
+// u is the marshal info of the message.
+func makeMessageSliceMarshaler(u *marshalInfo) (sizer, marshaler) {
+ return func(ptr pointer, tagsize int) int {
+ s := ptr.getPointerSlice()
+ n := 0
+ for _, v := range s {
+ if v.isNil() {
+ continue
+ }
+ siz := u.size(v)
+ n += siz + SizeVarint(uint64(siz)) + tagsize
+ }
+ return n
+ },
+ func(b []byte, ptr pointer, wiretag uint64, deterministic bool) ([]byte, error) {
+ s := ptr.getPointerSlice()
+ var err, errreq error
+ for _, v := range s {
+ if v.isNil() {
+ return b, errRepeatedHasNil
+ }
+ b = appendVarint(b, wiretag)
+ siz := u.cachedsize(v)
+ b = appendVarint(b, uint64(siz))
+ b, err = u.marshal(b, v, deterministic)
+
+ if err != nil {
+ if _, ok := err.(*RequiredNotSetError); ok {
+ // Required field in submessage is not set.
+ // We record the error but keep going, to give a complete marshaling.
+ if errreq == nil {
+ errreq = err
+ }
+ continue
+ }
+ if err == ErrNil {
+ err = errRepeatedHasNil
+ }
+ return b, err
+ }
+ }
+ return b, errreq
+ }
+}
+
+// makeMapMarshaler returns the sizer and marshaler for a map field.
+// f is the pointer to the reflect data structure of the field.
+func makeMapMarshaler(f *reflect.StructField) (sizer, marshaler) {
+ // figure out key and value type
+ t := f.Type
+ keyType := t.Key()
+ valType := t.Elem()
+ keyTags := strings.Split(f.Tag.Get("protobuf_key"), ",")
+ valTags := strings.Split(f.Tag.Get("protobuf_val"), ",")
+ keySizer, keyMarshaler := typeMarshaler(keyType, keyTags, false, false) // don't omit zero value in map
+ valSizer, valMarshaler := typeMarshaler(valType, valTags, false, false) // don't omit zero value in map
+ keyWireTag := 1<<3 | wiretype(keyTags[0])
+ valWireTag := 2<<3 | wiretype(valTags[0])
+
+ // We create an interface to get the addresses of the map key and value.
+ // If value is pointer-typed, the interface is a direct interface, the
+ // idata itself is the value. Otherwise, the idata is the pointer to the
+ // value.
+ // Key cannot be pointer-typed.
+ valIsPtr := valType.Kind() == reflect.Ptr
+ return func(ptr pointer, tagsize int) int {
+ m := ptr.asPointerTo(t).Elem() // the map
+ n := 0
+ for _, k := range m.MapKeys() {
+ ki := k.Interface()
+ vi := m.MapIndex(k).Interface()
+ kaddr := toAddrPointer(&ki, false) // pointer to key
+ vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
+ siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
+ n += siz + SizeVarint(uint64(siz)) + tagsize
+ }
+ return n
+ },
+ func(b []byte, ptr pointer, tag uint64, deterministic bool) ([]byte, error) {
+ m := ptr.asPointerTo(t).Elem() // the map
+ var err error
+ keys := m.MapKeys()
+ if len(keys) > 1 && deterministic {
+ sort.Sort(mapKeys(keys))
+ }
+ for _, k := range keys {
+ ki := k.Interface()
+ vi := m.MapIndex(k).Interface()
+ kaddr := toAddrPointer(&ki, false) // pointer to key
+ vaddr := toAddrPointer(&vi, valIsPtr) // pointer to value
+ b = appendVarint(b, tag)
+ siz := keySizer(kaddr, 1) + valSizer(vaddr, 1) // tag of key = 1 (size=1), tag of val = 2 (size=1)
+ b = appendVarint(b, uint64(siz))
+ b, err = keyMarshaler(b, kaddr, keyWireTag, deterministic)
+ if err != nil {
+ return b, err
+ }
+ b, err = valMarshaler(b, vaddr, valWireTag, deterministic)
+ if err != nil && err != ErrNil { // allow nil value in map
+ return b, err
+ }
+ }
+ return b, nil
+ }
+}
+
+// makeOneOfMarshaler returns the sizer and marshaler for a oneof field.
+// fi is the marshal info of the field.
+// f is the pointer to the reflect data structure of the field.
+func makeOneOfMarshaler(fi *marshalFieldInfo, f *reflect.StructField) (sizer, marshaler) {
+ // Oneof field is an interface. We need to get the actual data type on the fly.
+ t := f.Type
+ return func(ptr pointer, _ int) int {
+ p := ptr.getInterfacePointer()
+ if p.isNil() {
+ return 0
+ }
+ v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct
+ telem := v.Type()
+ e := fi.oneofElems[telem]
+ return e.sizer(p, e.tagsize)
+ },
+ func(b []byte, ptr pointer, _ uint64, deterministic bool) ([]byte, error) {
+ p := ptr.getInterfacePointer()
+ if p.isNil() {
+ return b, nil
+ }
+ v := ptr.asPointerTo(t).Elem().Elem().Elem() // *interface -> interface -> *struct -> struct
+ telem := v.Type()
+ if telem.Field(0).Type.Kind() == reflect.Ptr && p.getPointer().isNil() {
+ return b, errOneofHasNil
+ }
+ e := fi.oneofElems[telem]
+ return e.marshaler(b, p, e.wiretag, deterministic)
+ }
+}
+
+// sizeExtensions computes the size of encoded data for a XXX_InternalExtensions field.
+func (u *marshalInfo) sizeExtensions(ext *XXX_InternalExtensions) int {
+ m, mu := ext.extensionsRead()
+ if m == nil {
+ return 0
+ }
+ mu.Lock()
+
+ n := 0
+ for _, e := range m {
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ n += len(e.enc)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ n += ei.sizer(p, ei.tagsize)
+ }
+ mu.Unlock()
+ return n
+}
+
+// appendExtensions marshals a XXX_InternalExtensions field to the end of byte slice b.
+func (u *marshalInfo) appendExtensions(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) {
+ m, mu := ext.extensionsRead()
+ if m == nil {
+ return b, nil
+ }
+ mu.Lock()
+ defer mu.Unlock()
+
+ var err error
+
+ // Fast-path for common cases: zero or one extensions.
+ // Don't bother sorting the keys.
+ if len(m) <= 1 {
+ for _, e := range m {
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ b = append(b, e.enc...)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
+ if err != nil {
+ return b, err
+ }
+ }
+ return b, nil
+ }
+
+ // Sort the keys to provide a deterministic encoding.
+ // Not sure this is required, but the old code does it.
+ keys := make([]int, 0, len(m))
+ for k := range m {
+ keys = append(keys, int(k))
+ }
+ sort.Ints(keys)
+
+ for _, k := range keys {
+ e := m[int32(k)]
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ b = append(b, e.enc...)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
+ if err != nil {
+ return b, err
+ }
+ }
+ return b, nil
+}
+
+// message set format is:
+// message MessageSet {
+// repeated group Item = 1 {
+// required int32 type_id = 2;
+// required string message = 3;
+// };
+// }
+
+// sizeMessageSet computes the size of encoded data for a XXX_InternalExtensions field
+// in message set format (above).
+func (u *marshalInfo) sizeMessageSet(ext *XXX_InternalExtensions) int {
+ m, mu := ext.extensionsRead()
+ if m == nil {
+ return 0
+ }
+ mu.Lock()
+
+ n := 0
+ for id, e := range m {
+ n += 2 // start group, end group. tag = 1 (size=1)
+ n += SizeVarint(uint64(id)) + 1 // type_id, tag = 2 (size=1)
+
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
+ siz := len(msgWithLen)
+ n += siz + 1 // message, tag = 3 (size=1)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ n += ei.sizer(p, 1) // message, tag = 3 (size=1)
+ }
+ mu.Unlock()
+ return n
+}
+
+// appendMessageSet marshals a XXX_InternalExtensions field in message set format (above)
+// to the end of byte slice b.
+func (u *marshalInfo) appendMessageSet(b []byte, ext *XXX_InternalExtensions, deterministic bool) ([]byte, error) {
+ m, mu := ext.extensionsRead()
+ if m == nil {
+ return b, nil
+ }
+ mu.Lock()
+ defer mu.Unlock()
+
+ var err error
+
+ // Fast-path for common cases: zero or one extensions.
+ // Don't bother sorting the keys.
+ if len(m) <= 1 {
+ for id, e := range m {
+ b = append(b, 1<<3|WireStartGroup)
+ b = append(b, 2<<3|WireVarint)
+ b = appendVarint(b, uint64(id))
+
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
+ b = append(b, 3<<3|WireBytes)
+ b = append(b, msgWithLen...)
+ b = append(b, 1<<3|WireEndGroup)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
+ if err != nil {
+ return b, err
+ }
+ b = append(b, 1<<3|WireEndGroup)
+ }
+ return b, nil
+ }
+
+ // Sort the keys to provide a deterministic encoding.
+ keys := make([]int, 0, len(m))
+ for k := range m {
+ keys = append(keys, int(k))
+ }
+ sort.Ints(keys)
+
+ for _, id := range keys {
+ e := m[int32(id)]
+ b = append(b, 1<<3|WireStartGroup)
+ b = append(b, 2<<3|WireVarint)
+ b = appendVarint(b, uint64(id))
+
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ msgWithLen := skipVarint(e.enc) // skip old tag, but leave the length varint
+ b = append(b, 3<<3|WireBytes)
+ b = append(b, msgWithLen...)
+ b = append(b, 1<<3|WireEndGroup)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ b, err = ei.marshaler(b, p, 3<<3|WireBytes, deterministic)
+ b = append(b, 1<<3|WireEndGroup)
+ if err != nil {
+ return b, err
+ }
+ }
+ return b, nil
+}
+
+// sizeV1Extensions computes the size of encoded data for a V1-API extension field.
+func (u *marshalInfo) sizeV1Extensions(m map[int32]Extension) int {
+ if m == nil {
+ return 0
+ }
+
+ n := 0
+ for _, e := range m {
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ n += len(e.enc)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ n += ei.sizer(p, ei.tagsize)
+ }
+ return n
+}
+
+// appendV1Extensions marshals a V1-API extension field to the end of byte slice b.
+func (u *marshalInfo) appendV1Extensions(b []byte, m map[int32]Extension, deterministic bool) ([]byte, error) {
+ if m == nil {
+ return b, nil
+ }
+
+ // Sort the keys to provide a deterministic encoding.
+ keys := make([]int, 0, len(m))
+ for k := range m {
+ keys = append(keys, int(k))
+ }
+ sort.Ints(keys)
+
+ var err error
+ for _, k := range keys {
+ e := m[int32(k)]
+ if e.value == nil || e.desc == nil {
+ // Extension is only in its encoded form.
+ b = append(b, e.enc...)
+ continue
+ }
+
+ // We don't skip extensions that have an encoded form set,
+ // because the extension value may have been mutated after
+ // the last time this function was called.
+
+ ei := u.getExtElemInfo(e.desc)
+ v := e.value
+ p := toAddrPointer(&v, ei.isptr)
+ b, err = ei.marshaler(b, p, ei.wiretag, deterministic)
+ if err != nil {
+ return b, err
+ }
+ }
+ return b, nil
+}
+
+// newMarshaler is the interface representing objects that can marshal themselves.
+//
+// This exists to support protoc-gen-go generated messages.
+// The proto package will stop type-asserting to this interface in the future.
+//
+// DO NOT DEPEND ON THIS.
+type newMarshaler interface {
+ XXX_Size() int
+ XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
+}
+
+// Size returns the encoded size of a protocol buffer message.
+// This is the main entry point.
+func Size(pb Message) int {
+ if m, ok := pb.(newMarshaler); ok {
+ return m.XXX_Size()
+ }
+ if m, ok := pb.(Marshaler); ok {
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ b, _ := m.Marshal()
+ return len(b)
+ }
+ // in case somehow we didn't generate the wrapper
+ if pb == nil {
+ return 0
+ }
+ var info InternalMessageInfo
+ return info.Size(pb)
+}
+
+// Marshal takes a protocol buffer message
+// and encodes it into the wire format, returning the data.
+// This is the main entry point.
+func Marshal(pb Message) ([]byte, error) {
+ if m, ok := pb.(newMarshaler); ok {
+ siz := m.XXX_Size()
+ b := make([]byte, 0, siz)
+ return m.XXX_Marshal(b, false)
+ }
+ if m, ok := pb.(Marshaler); ok {
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ return m.Marshal()
+ }
+ // in case somehow we didn't generate the wrapper
+ if pb == nil {
+ return nil, ErrNil
+ }
+ var info InternalMessageInfo
+ siz := info.Size(pb)
+ b := make([]byte, 0, siz)
+ return info.Marshal(b, pb, false)
+}
+
+// Marshal takes a protocol buffer message
+// and encodes it into the wire format, writing the result to the
+// Buffer.
+// This is an alternative entry point. It is not necessary to use
+// a Buffer for most applications.
+func (p *Buffer) Marshal(pb Message) error {
+ var err error
+ if m, ok := pb.(newMarshaler); ok {
+ siz := m.XXX_Size()
+ p.grow(siz) // make sure buf has enough capacity
+ p.buf, err = m.XXX_Marshal(p.buf, p.deterministic)
+ return err
+ }
+ if m, ok := pb.(Marshaler); ok {
+ // If the message can marshal itself, let it do it, for compatibility.
+ // NOTE: This is not efficient.
+ b, err := m.Marshal()
+ p.buf = append(p.buf, b...)
+ return err
+ }
+ // in case somehow we didn't generate the wrapper
+ if pb == nil {
+ return ErrNil
+ }
+ var info InternalMessageInfo
+ siz := info.Size(pb)
+ p.grow(siz) // make sure buf has enough capacity
+ p.buf, err = info.Marshal(p.buf, pb, p.deterministic)
+ return err
+}
+
+// grow grows the buffer's capacity, if necessary, to guarantee space for
+// another n bytes. After grow(n), at least n bytes can be written to the
+// buffer without another allocation.
+func (p *Buffer) grow(n int) {
+ need := len(p.buf) + n
+ if need <= cap(p.buf) {
+ return
+ }
+ newCap := len(p.buf) * 2
+ if newCap < need {
+ newCap = need
+ }
+ p.buf = append(make([]byte, 0, newCap), p.buf...)
+}
diff --git a/vendor/github.com/golang/protobuf/proto/table_merge.go b/vendor/github.com/golang/protobuf/proto/table_merge.go
new file mode 100644
index 000000000..5525def6a
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/proto/table_merge.go
@@ -0,0 +1,654 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2016 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package proto
+
+import (
+ "fmt"
+ "reflect"
+ "strings"
+ "sync"
+ "sync/atomic"
+)
+
+// Merge merges the src message into dst.
+// This assumes that dst and src of the same type and are non-nil.
+func (a *InternalMessageInfo) Merge(dst, src Message) {
+ mi := atomicLoadMergeInfo(&a.merge)
+ if mi == nil {
+ mi = getMergeInfo(reflect.TypeOf(dst).Elem())
+ atomicStoreMergeInfo(&a.merge, mi)
+ }
+ mi.merge(toPointer(&dst), toPointer(&src))
+}
+
+type mergeInfo struct {
+ typ reflect.Type
+
+ initialized int32 // 0: only typ is valid, 1: everything is valid
+ lock sync.Mutex
+
+ fields []mergeFieldInfo
+ unrecognized field // Offset of XXX_unrecognized
+}
+
+type mergeFieldInfo struct {
+ field field // Offset of field, guaranteed to be valid
+
+ // isPointer reports whether the value in the field is a pointer.
+ // This is true for the following situations:
+ // * Pointer to struct
+ // * Pointer to basic type (proto2 only)
+ // * Slice (first value in slice header is a pointer)
+ // * String (first value in string header is a pointer)
+ isPointer bool
+
+ // basicWidth reports the width of the field assuming that it is directly
+ // embedded in the struct (as is the case for basic types in proto3).
+ // The possible values are:
+ // 0: invalid
+ // 1: bool
+ // 4: int32, uint32, float32
+ // 8: int64, uint64, float64
+ basicWidth int
+
+ // Where dst and src are pointers to the types being merged.
+ merge func(dst, src pointer)
+}
+
+var (
+ mergeInfoMap = map[reflect.Type]*mergeInfo{}
+ mergeInfoLock sync.Mutex
+)
+
+func getMergeInfo(t reflect.Type) *mergeInfo {
+ mergeInfoLock.Lock()
+ defer mergeInfoLock.Unlock()
+ mi := mergeInfoMap[t]
+ if mi == nil {
+ mi = &mergeInfo{typ: t}
+ mergeInfoMap[t] = mi
+ }
+ return mi
+}
+
+// merge merges src into dst assuming they are both of type *mi.typ.
+func (mi *mergeInfo) merge(dst, src pointer) {
+ if dst.isNil() {
+ panic("proto: nil destination")
+ }
+ if src.isNil() {
+ return // Nothing to do.
+ }
+
+ if atomic.LoadInt32(&mi.initialized) == 0 {
+ mi.computeMergeInfo()
+ }
+
+ for _, fi := range mi.fields {
+ sfp := src.offset(fi.field)
+
+ // As an optimization, we can avoid the merge function call cost
+ // if we know for sure that the source will have no effect
+ // by checking if it is the zero value.
+ if unsafeAllowed {
+ if fi.isPointer && sfp.getPointer().isNil() { // Could be slice or string
+ continue
+ }
+ if fi.basicWidth > 0 {
+ switch {
+ case fi.basicWidth == 1 && !*sfp.toBool():
+ continue
+ case fi.basicWidth == 4 && *sfp.toUint32() == 0:
+ continue
+ case fi.basicWidth == 8 && *sfp.toUint64() == 0:
+ continue
+ }
+ }
+ }
+
+ dfp := dst.offset(fi.field)
+ fi.merge(dfp, sfp)
+ }
+
+ // TODO: Make this faster?
+ out := dst.asPointerTo(mi.typ).Elem()
+ in := src.asPointerTo(mi.typ).Elem()
+ if emIn, err := extendable(in.Addr().Interface()); err == nil {
+ emOut, _ := extendable(out.Addr().Interface())
+ mIn, muIn := emIn.extensionsRead()
+ if mIn != nil {
+ mOut := emOut.extensionsWrite()
+ muIn.Lock()
+ mergeExtension(mOut, mIn)
+ muIn.Unlock()
+ }
+ }
+
+ if mi.unrecognized.IsValid() {
+ if b := *src.offset(mi.unrecognized).toBytes(); len(b) > 0 {
+ *dst.offset(mi.unrecognized).toBytes() = append([]byte(nil), b...)
+ }
+ }
+}
+
+func (mi *mergeInfo) computeMergeInfo() {
+ mi.lock.Lock()
+ defer mi.lock.Unlock()
+ if mi.initialized != 0 {
+ return
+ }
+ t := mi.typ
+ n := t.NumField()
+
+ props := GetProperties(t)
+ for i := 0; i < n; i++ {
+ f := t.Field(i)
+ if strings.HasPrefix(f.Name, "XXX_") {
+ continue
+ }
+
+ mfi := mergeFieldInfo{field: toField(&f)}
+ tf := f.Type
+
+ // As an optimization, we can avoid the merge function call cost
+ // if we know for sure that the source will have no effect
+ // by checking if it is the zero value.
+ if unsafeAllowed {
+ switch tf.Kind() {
+ case reflect.Ptr, reflect.Slice, reflect.String:
+ // As a special case, we assume slices and strings are pointers
+ // since we know that the first field in the SliceSlice or
+ // StringHeader is a data pointer.
+ mfi.isPointer = true
+ case reflect.Bool:
+ mfi.basicWidth = 1
+ case reflect.Int32, reflect.Uint32, reflect.Float32:
+ mfi.basicWidth = 4
+ case reflect.Int64, reflect.Uint64, reflect.Float64:
+ mfi.basicWidth = 8
+ }
+ }
+
+ // Unwrap tf to get at its most basic type.
+ var isPointer, isSlice bool
+ if tf.Kind() == reflect.Slice && tf.Elem().Kind() != reflect.Uint8 {
+ isSlice = true
+ tf = tf.Elem()
+ }
+ if tf.Kind() == reflect.Ptr {
+ isPointer = true
+ tf = tf.Elem()
+ }
+ if isPointer && isSlice && tf.Kind() != reflect.Struct {
+ panic("both pointer and slice for basic type in " + tf.Name())
+ }
+
+ switch tf.Kind() {
+ case reflect.Int32:
+ switch {
+ case isSlice: // E.g., []int32
+ mfi.merge = func(dst, src pointer) {
+ // NOTE: toInt32Slice is not defined (see pointer_reflect.go).
+ /*
+ sfsp := src.toInt32Slice()
+ if *sfsp != nil {
+ dfsp := dst.toInt32Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []int64{}
+ }
+ }
+ */
+ sfs := src.getInt32Slice()
+ if sfs != nil {
+ dfs := dst.getInt32Slice()
+ dfs = append(dfs, sfs...)
+ if dfs == nil {
+ dfs = []int32{}
+ }
+ dst.setInt32Slice(dfs)
+ }
+ }
+ case isPointer: // E.g., *int32
+ mfi.merge = func(dst, src pointer) {
+ // NOTE: toInt32Ptr is not defined (see pointer_reflect.go).
+ /*
+ sfpp := src.toInt32Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toInt32Ptr()
+ if *dfpp == nil {
+ *dfpp = Int32(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ */
+ sfp := src.getInt32Ptr()
+ if sfp != nil {
+ dfp := dst.getInt32Ptr()
+ if dfp == nil {
+ dst.setInt32Ptr(*sfp)
+ } else {
+ *dfp = *sfp
+ }
+ }
+ }
+ default: // E.g., int32
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toInt32(); v != 0 {
+ *dst.toInt32() = v
+ }
+ }
+ }
+ case reflect.Int64:
+ switch {
+ case isSlice: // E.g., []int64
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toInt64Slice()
+ if *sfsp != nil {
+ dfsp := dst.toInt64Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []int64{}
+ }
+ }
+ }
+ case isPointer: // E.g., *int64
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toInt64Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toInt64Ptr()
+ if *dfpp == nil {
+ *dfpp = Int64(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., int64
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toInt64(); v != 0 {
+ *dst.toInt64() = v
+ }
+ }
+ }
+ case reflect.Uint32:
+ switch {
+ case isSlice: // E.g., []uint32
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toUint32Slice()
+ if *sfsp != nil {
+ dfsp := dst.toUint32Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []uint32{}
+ }
+ }
+ }
+ case isPointer: // E.g., *uint32
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toUint32Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toUint32Ptr()
+ if *dfpp == nil {
+ *dfpp = Uint32(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., uint32
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toUint32(); v != 0 {
+ *dst.toUint32() = v
+ }
+ }
+ }
+ case reflect.Uint64:
+ switch {
+ case isSlice: // E.g., []uint64
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toUint64Slice()
+ if *sfsp != nil {
+ dfsp := dst.toUint64Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []uint64{}
+ }
+ }
+ }
+ case isPointer: // E.g., *uint64
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toUint64Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toUint64Ptr()
+ if *dfpp == nil {
+ *dfpp = Uint64(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., uint64
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toUint64(); v != 0 {
+ *dst.toUint64() = v
+ }
+ }
+ }
+ case reflect.Float32:
+ switch {
+ case isSlice: // E.g., []float32
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toFloat32Slice()
+ if *sfsp != nil {
+ dfsp := dst.toFloat32Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []float32{}
+ }
+ }
+ }
+ case isPointer: // E.g., *float32
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toFloat32Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toFloat32Ptr()
+ if *dfpp == nil {
+ *dfpp = Float32(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., float32
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toFloat32(); v != 0 {
+ *dst.toFloat32() = v
+ }
+ }
+ }
+ case reflect.Float64:
+ switch {
+ case isSlice: // E.g., []float64
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toFloat64Slice()
+ if *sfsp != nil {
+ dfsp := dst.toFloat64Slice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []float64{}
+ }
+ }
+ }
+ case isPointer: // E.g., *float64
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toFloat64Ptr()
+ if *sfpp != nil {
+ dfpp := dst.toFloat64Ptr()
+ if *dfpp == nil {
+ *dfpp = Float64(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., float64
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toFloat64(); v != 0 {
+ *dst.toFloat64() = v
+ }
+ }
+ }
+ case reflect.Bool:
+ switch {
+ case isSlice: // E.g., []bool
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toBoolSlice()
+ if *sfsp != nil {
+ dfsp := dst.toBoolSlice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []bool{}
+ }
+ }
+ }
+ case isPointer: // E.g., *bool
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toBoolPtr()
+ if *sfpp != nil {
+ dfpp := dst.toBoolPtr()
+ if *dfpp == nil {
+ *dfpp = Bool(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., bool
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toBool(); v {
+ *dst.toBool() = v
+ }
+ }
+ }
+ case reflect.String:
+ switch {
+ case isSlice: // E.g., []string
+ mfi.merge = func(dst, src pointer) {
+ sfsp := src.toStringSlice()
+ if *sfsp != nil {
+ dfsp := dst.toStringSlice()
+ *dfsp = append(*dfsp, *sfsp...)
+ if *dfsp == nil {
+ *dfsp = []string{}
+ }
+ }
+ }
+ case isPointer: // E.g., *string
+ mfi.merge = func(dst, src pointer) {
+ sfpp := src.toStringPtr()
+ if *sfpp != nil {
+ dfpp := dst.toStringPtr()
+ if *dfpp == nil {
+ *dfpp = String(**sfpp)
+ } else {
+ **dfpp = **sfpp
+ }
+ }
+ }
+ default: // E.g., string
+ mfi.merge = func(dst, src pointer) {
+ if v := *src.toString(); v != "" {
+ *dst.toString() = v
+ }
+ }
+ }
+ case reflect.Slice:
+ isProto3 := props.Prop[i].proto3
+ switch {
+ case isPointer:
+ panic("bad pointer in byte slice case in " + tf.Name())
+ case tf.Elem().Kind() != reflect.Uint8:
+ panic("bad element kind in byte slice case in " + tf.Name())
+ case isSlice: // E.g., [][]byte
+ mfi.merge = func(dst, src pointer) {
+ sbsp := src.toBytesSlice()
+ if *sbsp != nil {
+ dbsp := dst.toBytesSlice()
+ for _, sb := range *sbsp {
+ if sb == nil {
+ *dbsp = append(*dbsp, nil)
+ } else {
+ *dbsp = append(*dbsp, append([]byte{}, sb...))
+ }
+ }
+ if *dbsp == nil {
+ *dbsp = [][]byte{}
+ }
+ }
+ }
+ default: // E.g., []byte
+ mfi.merge = func(dst, src pointer) {
+ sbp := src.toBytes()
+ if *sbp != nil {
+ dbp := dst.toBytes()
+ if !isProto3 || len(*sbp) > 0 {
+ *dbp = append([]byte{}, *sbp...)
+ }
+ }
+ }
+ }
+ case reflect.Struct:
+ switch {
+ case !isPointer:
+ panic(fmt.Sprintf("message field %s without pointer", tf))
+ case isSlice: // E.g., []*pb.T
+ mi := getMergeInfo(tf)
+ mfi.merge = func(dst, src pointer) {
+ sps := src.getPointerSlice()
+ if sps != nil {
+ dps := dst.getPointerSlice()
+ for _, sp := range sps {
+ var dp pointer
+ if !sp.isNil() {
+ dp = valToPointer(reflect.New(tf))
+ mi.merge(dp, sp)
+ }
+ dps = append(dps, dp)
+ }
+ if dps == nil {
+ dps = []pointer{}
+ }
+ dst.setPointerSlice(dps)
+ }
+ }
+ default: // E.g., *pb.T
+ mi := getMergeInfo(tf)
+ mfi.merge = func(dst, src pointer) {
+ sp := src.getPointer()
+ if !sp.isNil() {
+ dp := dst.getPointer()
+ if dp.isNil() {
+ dp = valToPointer(reflect.New(tf))
+ dst.setPointer(dp)
+ }
+ mi.merge(dp, sp)
+ }
+ }
+ }
+ case reflect.Map:
+ switch {
+ case isPointer || isSlice:
+ panic("bad pointer or slice in map case in " + tf.Name())
+ default: // E.g., map[K]V
+ mfi.merge = func(dst, src pointer) {
+ sm := src.asPointerTo(tf).Elem()
+ if sm.Len() == 0 {
+ return
+ }
+ dm := dst.asPointerTo(tf).Elem()
+ if dm.IsNil() {
+ dm.Set(reflect.MakeMap(tf))
+ }
+
+ switch tf.Elem().Kind() {
+ case reflect.Ptr: // Proto struct (e.g., *T)
+ for _, key := range sm.MapKeys() {
+ val := sm.MapIndex(key)
+ val = reflect.ValueOf(Clone(val.Interface().(Message)))
+ dm.SetMapIndex(key, val)
+ }
+ case reflect.Slice: // E.g. Bytes type (e.g., []byte)
+ for _, key := range sm.MapKeys() {
+ val := sm.MapIndex(key)
+ val = reflect.ValueOf(append([]byte{}, val.Bytes()...))
+ dm.SetMapIndex(key, val)
+ }
+ default: // Basic type (e.g., string)
+ for _, key := range sm.MapKeys() {
+ val := sm.MapIndex(key)
+ dm.SetMapIndex(key, val)
+ }
+ }
+ }
+ }
+ case reflect.Interface:
+ // Must be oneof field.
+ switch {
+ case isPointer || isSlice:
+ panic("bad pointer or slice in interface case in " + tf.Name())
+ default: // E.g., interface{}
+ // TODO: Make this faster?
+ mfi.merge = func(dst, src pointer) {
+ su := src.asPointerTo(tf).Elem()
+ if !su.IsNil() {
+ du := dst.asPointerTo(tf).Elem()
+ typ := su.Elem().Type()
+ if du.IsNil() || du.Elem().Type() != typ {
+ du.Set(reflect.New(typ.Elem())) // Initialize interface if empty
+ }
+ sv := su.Elem().Elem().Field(0)
+ if sv.Kind() == reflect.Ptr && sv.IsNil() {
+ return
+ }
+ dv := du.Elem().Elem().Field(0)
+ if dv.Kind() == reflect.Ptr && dv.IsNil() {
+ dv.Set(reflect.New(sv.Type().Elem())) // Initialize proto message if empty
+ }
+ switch sv.Type().Kind() {
+ case reflect.Ptr: // Proto struct (e.g., *T)
+ Merge(dv.Interface().(Message), sv.Interface().(Message))
+ case reflect.Slice: // E.g. Bytes type (e.g., []byte)
+ dv.Set(reflect.ValueOf(append([]byte{}, sv.Bytes()...)))
+ default: // Basic type (e.g., string)
+ dv.Set(sv)
+ }
+ }
+ }
+ }
+ default:
+ panic(fmt.Sprintf("merger not found for type:%s", tf))
+ }
+ mi.fields = append(mi.fields, mfi)
+ }
+
+ mi.unrecognized = invalidField
+ if f, ok := t.FieldByName("XXX_unrecognized"); ok {
+ if f.Type != reflect.TypeOf([]byte{}) {
+ panic("expected XXX_unrecognized to be of type []byte")
+ }
+ mi.unrecognized = toField(&f)
+ }
+
+ atomic.StoreInt32(&mi.initialized, 1)
+}
diff --git a/vendor/github.com/golang/protobuf/proto/table_unmarshal.go b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go
new file mode 100644
index 000000000..55f0340a3
--- /dev/null
+++ b/vendor/github.com/golang/protobuf/proto/table_unmarshal.go
@@ -0,0 +1,1967 @@
+// Go support for Protocol Buffers - Google's data interchange format
+//
+// Copyright 2016 The Go Authors. All rights reserved.
+// https://github.com/golang/protobuf
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package proto
+
+import (
+ "errors"
+ "fmt"
+ "io"
+ "math"
+ "reflect"
+ "strconv"
+ "strings"
+ "sync"
+ "sync/atomic"
+ "unicode/utf8"
+)
+
+// Unmarshal is the entry point from the generated .pb.go files.
+// This function is not intended to be used by non-generated code.
+// This function is not subject to any compatibility guarantee.
+// msg contains a pointer to a protocol buffer struct.
+// b is the data to be unmarshaled into the protocol buffer.
+// a is a pointer to a place to store cached unmarshal information.
+func (a *InternalMessageInfo) Unmarshal(msg Message, b []byte) error {
+ // Load the unmarshal information for this message type.
+ // The atomic load ensures memory consistency.
+ u := atomicLoadUnmarshalInfo(&a.unmarshal)
+ if u == nil {
+ // Slow path: find unmarshal info for msg, update a with it.
+ u = getUnmarshalInfo(reflect.TypeOf(msg).Elem())
+ atomicStoreUnmarshalInfo(&a.unmarshal, u)
+ }
+ // Then do the unmarshaling.
+ err := u.unmarshal(toPointer(&msg), b)
+ return err
+}
+
+type unmarshalInfo struct {
+ typ reflect.Type // type of the protobuf struct
+
+ // 0 = only typ field is initialized
+ // 1 = completely initialized
+ initialized int32
+ lock sync.Mutex // prevents double initialization
+ dense []unmarshalFieldInfo // fields indexed by tag #
+ sparse map[uint64]unmarshalFieldInfo // fields indexed by tag #
+ reqFields []string // names of required fields
+ reqMask uint64 // 1<<len(reqFields)-1
+ unrecognized field // offset of []byte to put unrecognized data (or invalidField if we should throw it away)
+ extensions field // offset of extensions field (of type proto.XXX_InternalExtensions), or invalidField if it does not exist
+ oldExtensions field // offset of old-form extensions field (of type map[int]Extension)
+ extensionRanges []ExtensionRange // if non-nil, implies extensions field is valid
+ isMessageSet bool // if true, implies extensions field is valid
+}
+
+// An unmarshaler takes a stream of bytes and a pointer to a field of a message.
+// It decodes the field, stores it at f, and returns the unused bytes.
+// w is the wire encoding.
+// b is the data after the tag and wire encoding have been read.
+type unmarshaler func(b []byte, f pointer, w int) ([]byte, error)
+
+type unmarshalFieldInfo struct {
+ // location of the field in the proto message structure.
+ field field
+
+ // function to unmarshal the data for the field.
+ unmarshal unmarshaler
+
+ // if a required field, contains a single set bit at this field's index in the required field list.
+ reqMask uint64
+}
+
+var (
+ unmarshalInfoMap = map[reflect.Type]*unmarshalInfo{}
+ unmarshalInfoLock sync.Mutex
+)
+
+// getUnmarshalInfo returns the data structure which can be
+// subsequently used to unmarshal a message of the given type.
+// t is the type of the message (note: not pointer to message).
+func getUnmarshalInfo(t reflect.Type) *unmarshalInfo {
+ // It would be correct to return a new unmarshalInfo
+ // unconditionally. We would end up allocating one
+ // per occurrence of that type as a message or submessage.
+ // We use a cache here just to reduce memory usage.
+ unmarshalInfoLock.Lock()
+ defer unmarshalInfoLock.Unlock()
+ u := unmarshalInfoMap[t]
+ if u == nil {
+ u = &unmarshalInfo{typ: t}
+ // Note: we just set the type here. The rest of the fields
+ // will be initialized on first use.
+ unmarshalInfoMap[t] = u
+ }
+ return u
+}
+
+// unmarshal does the main work of unmarshaling a message.
+// u provides type information used to unmarshal the message.
+// m is a pointer to a protocol buffer message.
+// b is a byte stream to unmarshal into m.
+// This is top routine used when recursively unmarshaling submessages.
+func (u *unmarshalInfo) unmarshal(m pointer, b []byte) error {
+ if atomic.LoadInt32(&u.initialized) == 0 {
+ u.computeUnmarshalInfo()
+ }
+ if u.isMessageSet {
+ return UnmarshalMessageSet(b, m.offset(u.extensions).toExtensions())
+ }
+ var reqMask uint64 // bitmask of required fields we've seen.
+ var rnse *RequiredNotSetError // an instance of a RequiredNotSetError returned by a submessage.
+ for len(b) > 0 {
+ // Read tag and wire type.
+ // Special case 1 and 2 byte varints.
+ var x uint64
+ if b[0] < 128 {
+ x = uint64(b[0])
+ b = b[1:]
+ } else if len(b) >= 2 && b[1] < 128 {
+ x = uint64(b[0]&0x7f) + uint64(b[1])<<7
+ b = b[2:]
+ } else {
+ var n int
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ }
+ tag := x >> 3
+ wire := int(x) & 7
+
+ // Dispatch on the tag to one of the unmarshal* functions below.
+ var f unmarshalFieldInfo
+ if tag < uint64(len(u.dense)) {
+ f = u.dense[tag]
+ } else {
+ f = u.sparse[tag]
+ }
+ if fn := f.unmarshal; fn != nil {
+ var err error
+ b, err = fn(b, m.offset(f.field), wire)
+ if err == nil {
+ reqMask |= f.reqMask
+ continue
+ }
+ if r, ok := err.(*RequiredNotSetError); ok {
+ // Remember this error, but keep parsing. We need to produce
+ // a full parse even if a required field is missing.
+ rnse = r
+ reqMask |= f.reqMask
+ continue
+ }
+ if err != errInternalBadWireType {
+ return err
+ }
+ // Fragments with bad wire type are treated as unknown fields.
+ }
+
+ // Unknown tag.
+ if !u.unrecognized.IsValid() {
+ // Don't keep unrecognized data; just skip it.
+ var err error
+ b, err = skipField(b, wire)
+ if err != nil {
+ return err
+ }
+ continue
+ }
+ // Keep unrecognized data around.
+ // maybe in extensions, maybe in the unrecognized field.
+ z := m.offset(u.unrecognized).toBytes()
+ var emap map[int32]Extension
+ var e Extension
+ for _, r := range u.extensionRanges {
+ if uint64(r.Start) <= tag && tag <= uint64(r.End) {
+ if u.extensions.IsValid() {
+ mp := m.offset(u.extensions).toExtensions()
+ emap = mp.extensionsWrite()
+ e = emap[int32(tag)]
+ z = &e.enc
+ break
+ }
+ if u.oldExtensions.IsValid() {
+ p := m.offset(u.oldExtensions).toOldExtensions()
+ emap = *p
+ if emap == nil {
+ emap = map[int32]Extension{}
+ *p = emap
+ }
+ e = emap[int32(tag)]
+ z = &e.enc
+ break
+ }
+ panic("no extensions field available")
+ }
+ }
+
+ // Use wire type to skip data.
+ var err error
+ b0 := b
+ b, err = skipField(b, wire)
+ if err != nil {
+ return err
+ }
+ *z = encodeVarint(*z, tag<<3|uint64(wire))
+ *z = append(*z, b0[:len(b0)-len(b)]...)
+
+ if emap != nil {
+ emap[int32(tag)] = e
+ }
+ }
+ if rnse != nil {
+ // A required field of a submessage/group is missing. Return that error.
+ return rnse
+ }
+ if reqMask != u.reqMask {
+ // A required field of this message is missing.
+ for _, n := range u.reqFields {
+ if reqMask&1 == 0 {
+ return &RequiredNotSetError{n}
+ }
+ reqMask >>= 1
+ }
+ }
+ return nil
+}
+
+// computeUnmarshalInfo fills in u with information for use
+// in unmarshaling protocol buffers of type u.typ.
+func (u *unmarshalInfo) computeUnmarshalInfo() {
+ u.lock.Lock()
+ defer u.lock.Unlock()
+ if u.initialized != 0 {
+ return
+ }
+ t := u.typ
+ n := t.NumField()
+
+ // Set up the "not found" value for the unrecognized byte buffer.
+ // This is the default for proto3.
+ u.unrecognized = invalidField
+ u.extensions = invalidField
+ u.oldExtensions = invalidField
+
+ // List of the generated type and offset for each oneof field.
+ type oneofField struct {
+ ityp reflect.Type // interface type of oneof field
+ field field // offset in containing message
+ }
+ var oneofFields []oneofField
+
+ for i := 0; i < n; i++ {
+ f := t.Field(i)
+ if f.Name == "XXX_unrecognized" {
+ // The byte slice used to hold unrecognized input is special.
+ if f.Type != reflect.TypeOf(([]byte)(nil)) {
+ panic("bad type for XXX_unrecognized field: " + f.Type.Name())
+ }
+ u.unrecognized = toField(&f)
+ continue
+ }
+ if f.Name == "XXX_InternalExtensions" {
+ // Ditto here.
+ if f.Type != reflect.TypeOf(XXX_InternalExtensions{}) {
+ panic("bad type for XXX_InternalExtensions field: " + f.Type.Name())
+ }
+ u.extensions = toField(&f)
+ if f.Tag.Get("protobuf_messageset") == "1" {
+ u.isMessageSet = true
+ }
+ continue
+ }
+ if f.Name == "XXX_extensions" {
+ // An older form of the extensions field.
+ if f.Type != reflect.TypeOf((map[int32]Extension)(nil)) {
+ panic("bad type for XXX_extensions field: " + f.Type.Name())
+ }
+ u.oldExtensions = toField(&f)
+ continue
+ }
+ if f.Name == "XXX_NoUnkeyedLiteral" || f.Name == "XXX_sizecache" {
+ continue
+ }
+
+ oneof := f.Tag.Get("protobuf_oneof")
+ if oneof != "" {
+ oneofFields = append(oneofFields, oneofField{f.Type, toField(&f)})
+ // The rest of oneof processing happens below.
+ continue
+ }
+
+ tags := f.Tag.Get("protobuf")
+ tagArray := strings.Split(tags, ",")
+ if len(tagArray) < 2 {
+ panic("protobuf tag not enough fields in " + t.Name() + "." + f.Name + ": " + tags)
+ }
+ tag, err := strconv.Atoi(tagArray[1])
+ if err != nil {
+ panic("protobuf tag field not an integer: " + tagArray[1])
+ }
+
+ name := ""
+ for _, tag := range tagArray[3:] {
+ if strings.HasPrefix(tag, "name=") {
+ name = tag[5:]
+ }
+ }
+
+ // Extract unmarshaling function from the field (its type and tags).
+ unmarshal := fieldUnmarshaler(&f)
+
+ // Required field?
+ var reqMask uint64
+ if tagArray[2] == "req" {
+ bit := len(u.reqFields)
+ u.reqFields = append(u.reqFields, name)
+ reqMask = uint64(1) << uint(bit)
+ // TODO: if we have more than 64 required fields, we end up
+ // not verifying that all required fields are present.
+ // Fix this, perhaps using a count of required fields?
+ }
+
+ // Store the info in the correct slot in the message.
+ u.setTag(tag, toField(&f), unmarshal, reqMask)
+ }
+
+ // Find any types associated with oneof fields.
+ // TODO: XXX_OneofFuncs returns more info than we need. Get rid of some of it?
+ fn := reflect.Zero(reflect.PtrTo(t)).MethodByName("XXX_OneofFuncs")
+ if fn.IsValid() {
+ res := fn.Call(nil)[3] // last return value from XXX_OneofFuncs: []interface{}
+ for i := res.Len() - 1; i >= 0; i-- {
+ v := res.Index(i) // interface{}
+ tptr := reflect.ValueOf(v.Interface()).Type() // *Msg_X
+ typ := tptr.Elem() // Msg_X
+
+ f := typ.Field(0) // oneof implementers have one field
+ baseUnmarshal := fieldUnmarshaler(&f)
+ tagstr := strings.Split(f.Tag.Get("protobuf"), ",")[1]
+ tag, err := strconv.Atoi(tagstr)
+ if err != nil {
+ panic("protobuf tag field not an integer: " + tagstr)
+ }
+
+ // Find the oneof field that this struct implements.
+ // Might take O(n^2) to process all of the oneofs, but who cares.
+ for _, of := range oneofFields {
+ if tptr.Implements(of.ityp) {
+ // We have found the corresponding interface for this struct.
+ // That lets us know where this struct should be stored
+ // when we encounter it during unmarshaling.
+ unmarshal := makeUnmarshalOneof(typ, of.ityp, baseUnmarshal)
+ u.setTag(tag, of.field, unmarshal, 0)
+ }
+ }
+ }
+ }
+
+ // Get extension ranges, if any.
+ fn = reflect.Zero(reflect.PtrTo(t)).MethodByName("ExtensionRangeArray")
+ if fn.IsValid() {
+ if !u.extensions.IsValid() && !u.oldExtensions.IsValid() {
+ panic("a message with extensions, but no extensions field in " + t.Name())
+ }
+ u.extensionRanges = fn.Call(nil)[0].Interface().([]ExtensionRange)
+ }
+
+ // Explicitly disallow tag 0. This will ensure we flag an error
+ // when decoding a buffer of all zeros. Without this code, we
+ // would decode and skip an all-zero buffer of even length.
+ // [0 0] is [tag=0/wiretype=varint varint-encoded-0].
+ u.setTag(0, zeroField, func(b []byte, f pointer, w int) ([]byte, error) {
+ return nil, fmt.Errorf("proto: %s: illegal tag 0 (wire type %d)", t, w)
+ }, 0)
+
+ // Set mask for required field check.
+ u.reqMask = uint64(1)<<uint(len(u.reqFields)) - 1
+
+ atomic.StoreInt32(&u.initialized, 1)
+}
+
+// setTag stores the unmarshal information for the given tag.
+// tag = tag # for field
+// field/unmarshal = unmarshal info for that field.
+// reqMask = if required, bitmask for field position in required field list. 0 otherwise.
+func (u *unmarshalInfo) setTag(tag int, field field, unmarshal unmarshaler, reqMask uint64) {
+ i := unmarshalFieldInfo{field: field, unmarshal: unmarshal, reqMask: reqMask}
+ n := u.typ.NumField()
+ if tag >= 0 && (tag < 16 || tag < 2*n) { // TODO: what are the right numbers here?
+ for len(u.dense) <= tag {
+ u.dense = append(u.dense, unmarshalFieldInfo{})
+ }
+ u.dense[tag] = i
+ return
+ }
+ if u.sparse == nil {
+ u.sparse = map[uint64]unmarshalFieldInfo{}
+ }
+ u.sparse[uint64(tag)] = i
+}
+
+// fieldUnmarshaler returns an unmarshaler for the given field.
+func fieldUnmarshaler(f *reflect.StructField) unmarshaler {
+ if f.Type.Kind() == reflect.Map {
+ return makeUnmarshalMap(f)
+ }
+ return typeUnmarshaler(f.Type, f.Tag.Get("protobuf"))
+}
+
+// typeUnmarshaler returns an unmarshaler for the given field type / field tag pair.
+func typeUnmarshaler(t reflect.Type, tags string) unmarshaler {
+ tagArray := strings.Split(tags, ",")
+ encoding := tagArray[0]
+ name := "unknown"
+ for _, tag := range tagArray[3:] {
+ if strings.HasPrefix(tag, "name=") {
+ name = tag[5:]
+ }
+ }
+
+ // Figure out packaging (pointer, slice, or both)
+ slice := false
+ pointer := false
+ if t.Kind() == reflect.Slice && t.Elem().Kind() != reflect.Uint8 {
+ slice = true
+ t = t.Elem()
+ }
+ if t.Kind() == reflect.Ptr {
+ pointer = true
+ t = t.Elem()
+ }
+
+ // We'll never have both pointer and slice for basic types.
+ if pointer && slice && t.Kind() != reflect.Struct {
+ panic("both pointer and slice for basic type in " + t.Name())
+ }
+
+ switch t.Kind() {
+ case reflect.Bool:
+ if pointer {
+ return unmarshalBoolPtr
+ }
+ if slice {
+ return unmarshalBoolSlice
+ }
+ return unmarshalBoolValue
+ case reflect.Int32:
+ switch encoding {
+ case "fixed32":
+ if pointer {
+ return unmarshalFixedS32Ptr
+ }
+ if slice {
+ return unmarshalFixedS32Slice
+ }
+ return unmarshalFixedS32Value
+ case "varint":
+ // this could be int32 or enum
+ if pointer {
+ return unmarshalInt32Ptr
+ }
+ if slice {
+ return unmarshalInt32Slice
+ }
+ return unmarshalInt32Value
+ case "zigzag32":
+ if pointer {
+ return unmarshalSint32Ptr
+ }
+ if slice {
+ return unmarshalSint32Slice
+ }
+ return unmarshalSint32Value
+ }
+ case reflect.Int64:
+ switch encoding {
+ case "fixed64":
+ if pointer {
+ return unmarshalFixedS64Ptr
+ }
+ if slice {
+ return unmarshalFixedS64Slice
+ }
+ return unmarshalFixedS64Value
+ case "varint":
+ if pointer {
+ return unmarshalInt64Ptr
+ }
+ if slice {
+ return unmarshalInt64Slice
+ }
+ return unmarshalInt64Value
+ case "zigzag64":
+ if pointer {
+ return unmarshalSint64Ptr
+ }
+ if slice {
+ return unmarshalSint64Slice
+ }
+ return unmarshalSint64Value
+ }
+ case reflect.Uint32:
+ switch encoding {
+ case "fixed32":
+ if pointer {
+ return unmarshalFixed32Ptr
+ }
+ if slice {
+ return unmarshalFixed32Slice
+ }
+ return unmarshalFixed32Value
+ case "varint":
+ if pointer {
+ return unmarshalUint32Ptr
+ }
+ if slice {
+ return unmarshalUint32Slice
+ }
+ return unmarshalUint32Value
+ }
+ case reflect.Uint64:
+ switch encoding {
+ case "fixed64":
+ if pointer {
+ return unmarshalFixed64Ptr
+ }
+ if slice {
+ return unmarshalFixed64Slice
+ }
+ return unmarshalFixed64Value
+ case "varint":
+ if pointer {
+ return unmarshalUint64Ptr
+ }
+ if slice {
+ return unmarshalUint64Slice
+ }
+ return unmarshalUint64Value
+ }
+ case reflect.Float32:
+ if pointer {
+ return unmarshalFloat32Ptr
+ }
+ if slice {
+ return unmarshalFloat32Slice
+ }
+ return unmarshalFloat32Value
+ case reflect.Float64:
+ if pointer {
+ return unmarshalFloat64Ptr
+ }
+ if slice {
+ return unmarshalFloat64Slice
+ }
+ return unmarshalFloat64Value
+ case reflect.Map:
+ panic("map type in typeUnmarshaler in " + t.Name())
+ case reflect.Slice:
+ if pointer {
+ panic("bad pointer in slice case in " + t.Name())
+ }
+ if slice {
+ return unmarshalBytesSlice
+ }
+ return unmarshalBytesValue
+ case reflect.String:
+ if pointer {
+ return unmarshalStringPtr
+ }
+ if slice {
+ return unmarshalStringSlice
+ }
+ return unmarshalStringValue
+ case reflect.Struct:
+ // message or group field
+ if !pointer {
+ panic(fmt.Sprintf("message/group field %s:%s without pointer", t, encoding))
+ }
+ switch encoding {
+ case "bytes":
+ if slice {
+ return makeUnmarshalMessageSlicePtr(getUnmarshalInfo(t), name)
+ }
+ return makeUnmarshalMessagePtr(getUnmarshalInfo(t), name)
+ case "group":
+ if slice {
+ return makeUnmarshalGroupSlicePtr(getUnmarshalInfo(t), name)
+ }
+ return makeUnmarshalGroupPtr(getUnmarshalInfo(t), name)
+ }
+ }
+ panic(fmt.Sprintf("unmarshaler not found type:%s encoding:%s", t, encoding))
+}
+
+// Below are all the unmarshalers for individual fields of various types.
+
+func unmarshalInt64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x)
+ *f.toInt64() = v
+ return b, nil
+}
+
+func unmarshalInt64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x)
+ *f.toInt64Ptr() = &v
+ return b, nil
+}
+
+func unmarshalInt64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x)
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x)
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ return b, nil
+}
+
+func unmarshalSint64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x>>1) ^ int64(x)<<63>>63
+ *f.toInt64() = v
+ return b, nil
+}
+
+func unmarshalSint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x>>1) ^ int64(x)<<63>>63
+ *f.toInt64Ptr() = &v
+ return b, nil
+}
+
+func unmarshalSint64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x>>1) ^ int64(x)<<63>>63
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int64(x>>1) ^ int64(x)<<63>>63
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ return b, nil
+}
+
+func unmarshalUint64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint64(x)
+ *f.toUint64() = v
+ return b, nil
+}
+
+func unmarshalUint64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint64(x)
+ *f.toUint64Ptr() = &v
+ return b, nil
+}
+
+func unmarshalUint64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint64(x)
+ s := f.toUint64Slice()
+ *s = append(*s, v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint64(x)
+ s := f.toUint64Slice()
+ *s = append(*s, v)
+ return b, nil
+}
+
+func unmarshalInt32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x)
+ *f.toInt32() = v
+ return b, nil
+}
+
+func unmarshalInt32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x)
+ f.setInt32Ptr(v)
+ return b, nil
+}
+
+func unmarshalInt32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x)
+ f.appendInt32Slice(v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x)
+ f.appendInt32Slice(v)
+ return b, nil
+}
+
+func unmarshalSint32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x>>1) ^ int32(x)<<31>>31
+ *f.toInt32() = v
+ return b, nil
+}
+
+func unmarshalSint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x>>1) ^ int32(x)<<31>>31
+ f.setInt32Ptr(v)
+ return b, nil
+}
+
+func unmarshalSint32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x>>1) ^ int32(x)<<31>>31
+ f.appendInt32Slice(v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := int32(x>>1) ^ int32(x)<<31>>31
+ f.appendInt32Slice(v)
+ return b, nil
+}
+
+func unmarshalUint32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint32(x)
+ *f.toUint32() = v
+ return b, nil
+}
+
+func unmarshalUint32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint32(x)
+ *f.toUint32Ptr() = &v
+ return b, nil
+}
+
+func unmarshalUint32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint32(x)
+ s := f.toUint32Slice()
+ *s = append(*s, v)
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ v := uint32(x)
+ s := f.toUint32Slice()
+ *s = append(*s, v)
+ return b, nil
+}
+
+func unmarshalFixed64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+ *f.toUint64() = v
+ return b[8:], nil
+}
+
+func unmarshalFixed64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+ *f.toUint64Ptr() = &v
+ return b[8:], nil
+}
+
+func unmarshalFixed64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+ s := f.toUint64Slice()
+ *s = append(*s, v)
+ b = b[8:]
+ }
+ return res, nil
+ }
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56
+ s := f.toUint64Slice()
+ *s = append(*s, v)
+ return b[8:], nil
+}
+
+func unmarshalFixedS64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
+ *f.toInt64() = v
+ return b[8:], nil
+}
+
+func unmarshalFixedS64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
+ *f.toInt64Ptr() = &v
+ return b[8:], nil
+}
+
+func unmarshalFixedS64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ b = b[8:]
+ }
+ return res, nil
+ }
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int64(b[0]) | int64(b[1])<<8 | int64(b[2])<<16 | int64(b[3])<<24 | int64(b[4])<<32 | int64(b[5])<<40 | int64(b[6])<<48 | int64(b[7])<<56
+ s := f.toInt64Slice()
+ *s = append(*s, v)
+ return b[8:], nil
+}
+
+func unmarshalFixed32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+ *f.toUint32() = v
+ return b[4:], nil
+}
+
+func unmarshalFixed32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+ *f.toUint32Ptr() = &v
+ return b[4:], nil
+}
+
+func unmarshalFixed32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+ s := f.toUint32Slice()
+ *s = append(*s, v)
+ b = b[4:]
+ }
+ return res, nil
+ }
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
+ s := f.toUint32Slice()
+ *s = append(*s, v)
+ return b[4:], nil
+}
+
+func unmarshalFixedS32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
+ *f.toInt32() = v
+ return b[4:], nil
+}
+
+func unmarshalFixedS32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
+ f.setInt32Ptr(v)
+ return b[4:], nil
+}
+
+func unmarshalFixedS32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
+ f.appendInt32Slice(v)
+ b = b[4:]
+ }
+ return res, nil
+ }
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := int32(b[0]) | int32(b[1])<<8 | int32(b[2])<<16 | int32(b[3])<<24
+ f.appendInt32Slice(v)
+ return b[4:], nil
+}
+
+func unmarshalBoolValue(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ // Note: any length varint is allowed, even though any sane
+ // encoder will use one byte.
+ // See https://github.com/golang/protobuf/issues/76
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ // TODO: check if x>1? Tests seem to indicate no.
+ v := x != 0
+ *f.toBool() = v
+ return b[n:], nil
+}
+
+func unmarshalBoolPtr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := x != 0
+ *f.toBoolPtr() = &v
+ return b[n:], nil
+}
+
+func unmarshalBoolSlice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ x, n = decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := x != 0
+ s := f.toBoolSlice()
+ *s = append(*s, v)
+ b = b[n:]
+ }
+ return res, nil
+ }
+ if w != WireVarint {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := x != 0
+ s := f.toBoolSlice()
+ *s = append(*s, v)
+ return b[n:], nil
+}
+
+func unmarshalFloat64Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
+ *f.toFloat64() = v
+ return b[8:], nil
+}
+
+func unmarshalFloat64Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
+ *f.toFloat64Ptr() = &v
+ return b[8:], nil
+}
+
+func unmarshalFloat64Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
+ s := f.toFloat64Slice()
+ *s = append(*s, v)
+ b = b[8:]
+ }
+ return res, nil
+ }
+ if w != WireFixed64 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 8 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float64frombits(uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56)
+ s := f.toFloat64Slice()
+ *s = append(*s, v)
+ return b[8:], nil
+}
+
+func unmarshalFloat32Value(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
+ *f.toFloat32() = v
+ return b[4:], nil
+}
+
+func unmarshalFloat32Ptr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
+ *f.toFloat32Ptr() = &v
+ return b[4:], nil
+}
+
+func unmarshalFloat32Slice(b []byte, f pointer, w int) ([]byte, error) {
+ if w == WireBytes { // packed
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ res := b[x:]
+ b = b[:x]
+ for len(b) > 0 {
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
+ s := f.toFloat32Slice()
+ *s = append(*s, v)
+ b = b[4:]
+ }
+ return res, nil
+ }
+ if w != WireFixed32 {
+ return b, errInternalBadWireType
+ }
+ if len(b) < 4 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := math.Float32frombits(uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24)
+ s := f.toFloat32Slice()
+ *s = append(*s, v)
+ return b[4:], nil
+}
+
+func unmarshalStringValue(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ *f.toString() = v
+ return b[x:], nil
+}
+
+func unmarshalStringPtr(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ *f.toStringPtr() = &v
+ return b[x:], nil
+}
+
+func unmarshalStringSlice(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := string(b[:x])
+ if !utf8.ValidString(v) {
+ return nil, errInvalidUTF8
+ }
+ s := f.toStringSlice()
+ *s = append(*s, v)
+ return b[x:], nil
+}
+
+var emptyBuf [0]byte
+
+func unmarshalBytesValue(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ // The use of append here is a trick which avoids the zeroing
+ // that would be required if we used a make/copy pair.
+ // We append to emptyBuf instead of nil because we want
+ // a non-nil result even when the length is 0.
+ v := append(emptyBuf[:], b[:x]...)
+ *f.toBytes() = v
+ return b[x:], nil
+}
+
+func unmarshalBytesSlice(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := append(emptyBuf[:], b[:x]...)
+ s := f.toBytesSlice()
+ *s = append(*s, v)
+ return b[x:], nil
+}
+
+func makeUnmarshalMessagePtr(sub *unmarshalInfo, name string) unmarshaler {
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ // First read the message field to see if something is there.
+ // The semantics of multiple submessages are weird. Instead of
+ // the last one winning (as it is for all other fields), multiple
+ // submessages are merged.
+ v := f.getPointer()
+ if v.isNil() {
+ v = valToPointer(reflect.New(sub.typ))
+ f.setPointer(v)
+ }
+ err := sub.unmarshal(v, b[:x])
+ if err != nil {
+ if r, ok := err.(*RequiredNotSetError); ok {
+ r.field = name + "." + r.field
+ } else {
+ return nil, err
+ }
+ }
+ return b[x:], err
+ }
+}
+
+func makeUnmarshalMessageSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireBytes {
+ return b, errInternalBadWireType
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := valToPointer(reflect.New(sub.typ))
+ err := sub.unmarshal(v, b[:x])
+ if err != nil {
+ if r, ok := err.(*RequiredNotSetError); ok {
+ r.field = name + "." + r.field
+ } else {
+ return nil, err
+ }
+ }
+ f.appendPointer(v)
+ return b[x:], err
+ }
+}
+
+func makeUnmarshalGroupPtr(sub *unmarshalInfo, name string) unmarshaler {
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireStartGroup {
+ return b, errInternalBadWireType
+ }
+ x, y := findEndGroup(b)
+ if x < 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := f.getPointer()
+ if v.isNil() {
+ v = valToPointer(reflect.New(sub.typ))
+ f.setPointer(v)
+ }
+ err := sub.unmarshal(v, b[:x])
+ if err != nil {
+ if r, ok := err.(*RequiredNotSetError); ok {
+ r.field = name + "." + r.field
+ } else {
+ return nil, err
+ }
+ }
+ return b[y:], err
+ }
+}
+
+func makeUnmarshalGroupSlicePtr(sub *unmarshalInfo, name string) unmarshaler {
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ if w != WireStartGroup {
+ return b, errInternalBadWireType
+ }
+ x, y := findEndGroup(b)
+ if x < 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ v := valToPointer(reflect.New(sub.typ))
+ err := sub.unmarshal(v, b[:x])
+ if err != nil {
+ if r, ok := err.(*RequiredNotSetError); ok {
+ r.field = name + "." + r.field
+ } else {
+ return nil, err
+ }
+ }
+ f.appendPointer(v)
+ return b[y:], err
+ }
+}
+
+func makeUnmarshalMap(f *reflect.StructField) unmarshaler {
+ t := f.Type
+ kt := t.Key()
+ vt := t.Elem()
+ unmarshalKey := typeUnmarshaler(kt, f.Tag.Get("protobuf_key"))
+ unmarshalVal := typeUnmarshaler(vt, f.Tag.Get("protobuf_val"))
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ // The map entry is a submessage. Figure out how big it is.
+ if w != WireBytes {
+ return nil, fmt.Errorf("proto: bad wiretype for map field: got %d want %d", w, WireBytes)
+ }
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ b = b[n:]
+ if x > uint64(len(b)) {
+ return nil, io.ErrUnexpectedEOF
+ }
+ r := b[x:] // unused data to return
+ b = b[:x] // data for map entry
+
+ // Note: we could use #keys * #values ~= 200 functions
+ // to do map decoding without reflection. Probably not worth it.
+ // Maps will be somewhat slow. Oh well.
+
+ // Read key and value from data.
+ k := reflect.New(kt)
+ v := reflect.New(vt)
+ for len(b) > 0 {
+ x, n := decodeVarint(b)
+ if n == 0 {
+ return nil, io.ErrUnexpectedEOF
+ }
+ wire := int(x) & 7
+ b = b[n:]
+
+ var err error
+ switch x >> 3 {
+ case 1:
+ b, err = unmarshalKey(b, valToPointer(k), wire)
+ case 2:
+ b, err = unmarshalVal(b, valToPointer(v), wire)
+ default:
+ err = errInternalBadWireType // skip unknown tag
+ }
+
+ if err == nil {
+ continue
+ }
+ if err != errInternalBadWireType {
+ return nil, err
+ }
+
+ // Skip past unknown fields.
+ b, err = skipField(b, wire)
+ if err != nil {
+ return nil, err
+ }
+ }
+
+ // Get map, allocate if needed.
+ m := f.asPointerTo(t).Elem() // an addressable map[K]T
+ if m.IsNil() {
+ m.Set(reflect.MakeMap(t))
+ }
+
+ // Insert into map.
+ m.SetMapIndex(k.Elem(), v.Elem())
+
+ return r, nil
+ }
+}
+
+// makeUnmarshalOneof makes an unmarshaler for oneof fields.
+// for:
+// message Msg {
+// oneof F {
+// int64 X = 1;
+// float64 Y = 2;
+// }
+// }
+// typ is the type of the concrete entry for a oneof case (e.g. Msg_X).
+// ityp is the interface type of the oneof field (e.g. isMsg_F).
+// unmarshal is the unmarshaler for the base type of the oneof case (e.g. int64).
+// Note that this function will be called once for each case in the oneof.
+func makeUnmarshalOneof(typ, ityp reflect.Type, unmarshal unmarshaler) unmarshaler {
+ sf := typ.Field(0)
+ field0 := toField(&sf)
+ return func(b []byte, f pointer, w int) ([]byte, error) {
+ // Allocate holder for value.
+ v := reflect.New(typ)
+
+ // Unmarshal data into holder.
+ // We unmarshal into the first field of the holder object.
+ var err error
+ b, err = unmarshal(b, valToPointer(v).offset(field0), w)
+ if err != nil {
+ return nil, err
+ }
+
+ // Write pointer to holder into target field.
+ f.asPointerTo(ityp).Elem().Set(v)
+
+ return b, nil
+ }
+}
+
+// Error used by decode internally.
+var errInternalBadWireType = errors.New("proto: internal error: bad wiretype")
+
+// skipField skips past a field of type wire and returns the remaining bytes.
+func skipField(b []byte, wire int) ([]byte, error) {
+ switch wire {
+ case WireVarint:
+ _, k := decodeVarint(b)
+ if k == 0 {
+ return b, io.ErrUnexpectedEOF
+ }
+ b = b[k:]
+ case WireFixed32:
+ if len(b) < 4 {
+ return b, io.ErrUnexpectedEOF
+ }
+ b = b[4:]
+ case WireFixed64:
+ if len(b) < 8 {
+ return b, io.ErrUnexpectedEOF
+ }
+ b = b[8:]
+ case WireBytes:
+ m, k := decodeVarint(b)
+ if k == 0 || uint64(len(b)-k) < m {
+ return b, io.ErrUnexpectedEOF
+ }
+ b = b[uint64(k)+m:]
+ case WireStartGroup:
+ _, i := findEndGroup(b)
+ if i == -1 {
+ return b, io.ErrUnexpectedEOF
+ }
+ b = b[i:]
+ default:
+ return b, fmt.Errorf("proto: can't skip unknown wire type %d", wire)
+ }
+ return b, nil
+}
+
+// findEndGroup finds the index of the next EndGroup tag.
+// Groups may be nested, so the "next" EndGroup tag is the first
+// unpaired EndGroup.
+// findEndGroup returns the indexes of the start and end of the EndGroup tag.
+// Returns (-1,-1) if it can't find one.
+func findEndGroup(b []byte) (int, int) {
+ depth := 1
+ i := 0
+ for {
+ x, n := decodeVarint(b[i:])
+ if n == 0 {
+ return -1, -1
+ }
+ j := i
+ i += n
+ switch x & 7 {
+ case WireVarint:
+ _, k := decodeVarint(b[i:])
+ if k == 0 {
+ return -1, -1
+ }
+ i += k
+ case WireFixed32:
+ if len(b)-4 < i {
+ return -1, -1
+ }
+ i += 4
+ case WireFixed64:
+ if len(b)-8 < i {
+ return -1, -1
+ }
+ i += 8
+ case WireBytes:
+ m, k := decodeVarint(b[i:])
+ if k == 0 {
+ return -1, -1
+ }
+ i += k
+ if uint64(len(b)-i) < m {
+ return -1, -1
+ }
+ i += int(m)
+ case WireStartGroup:
+ depth++
+ case WireEndGroup:
+ depth--
+ if depth == 0 {
+ return j, i
+ }
+ default:
+ return -1, -1
+ }
+ }
+}
+
+// encodeVarint appends a varint-encoded integer to b and returns the result.
+func encodeVarint(b []byte, x uint64) []byte {
+ for x >= 1<<7 {
+ b = append(b, byte(x&0x7f|0x80))
+ x >>= 7
+ }
+ return append(b, byte(x))
+}
+
+// decodeVarint reads a varint-encoded integer from b.
+// Returns the decoded integer and the number of bytes read.
+// If there is an error, it returns 0,0.
+func decodeVarint(b []byte) (uint64, int) {
+ var x, y uint64
+ if len(b) <= 0 {
+ goto bad
+ }
+ x = uint64(b[0])
+ if x < 0x80 {
+ return x, 1
+ }
+ x -= 0x80
+
+ if len(b) <= 1 {
+ goto bad
+ }
+ y = uint64(b[1])
+ x += y << 7
+ if y < 0x80 {
+ return x, 2
+ }
+ x -= 0x80 << 7
+
+ if len(b) <= 2 {
+ goto bad
+ }
+ y = uint64(b[2])
+ x += y << 14
+ if y < 0x80 {
+ return x, 3
+ }
+ x -= 0x80 << 14
+
+ if len(b) <= 3 {
+ goto bad
+ }
+ y = uint64(b[3])
+ x += y << 21
+ if y < 0x80 {
+ return x, 4
+ }
+ x -= 0x80 << 21
+
+ if len(b) <= 4 {
+ goto bad
+ }
+ y = uint64(b[4])
+ x += y << 28
+ if y < 0x80 {
+ return x, 5
+ }
+ x -= 0x80 << 28
+
+ if len(b) <= 5 {
+ goto bad
+ }
+ y = uint64(b[5])
+ x += y << 35
+ if y < 0x80 {
+ return x, 6
+ }
+ x -= 0x80 << 35
+
+ if len(b) <= 6 {
+ goto bad
+ }
+ y = uint64(b[6])
+ x += y << 42
+ if y < 0x80 {
+ return x, 7
+ }
+ x -= 0x80 << 42
+
+ if len(b) <= 7 {
+ goto bad
+ }
+ y = uint64(b[7])
+ x += y << 49
+ if y < 0x80 {
+ return x, 8
+ }
+ x -= 0x80 << 49
+
+ if len(b) <= 8 {
+ goto bad
+ }
+ y = uint64(b[8])
+ x += y << 56
+ if y < 0x80 {
+ return x, 9
+ }
+ x -= 0x80 << 56
+
+ if len(b) <= 9 {
+ goto bad
+ }
+ y = uint64(b[9])
+ x += y << 63
+ if y < 2 {
+ return x, 10
+ }
+
+bad:
+ return 0, 0
+}
diff --git a/vendor/github.com/golang/protobuf/proto/text.go b/vendor/github.com/golang/protobuf/proto/text.go
index 965876bf0..2205fdaad 100644
--- a/vendor/github.com/golang/protobuf/proto/text.go
+++ b/vendor/github.com/golang/protobuf/proto/text.go
@@ -50,7 +50,6 @@ import (
var (
newline = []byte("\n")
spaces = []byte(" ")
- gtNewline = []byte(">\n")
endBraceNewline = []byte("}\n")
backslashN = []byte{'\\', 'n'}
backslashR = []byte{'\\', 'r'}
@@ -170,11 +169,6 @@ func writeName(w *textWriter, props *Properties) error {
return nil
}
-// raw is the interface satisfied by RawMessage.
-type raw interface {
- Bytes() []byte
-}
-
func requiresQuotes(u string) bool {
// When type URL contains any characters except [0-9A-Za-z./\-]*, it must be quoted.
for _, ch := range u {
@@ -269,6 +263,10 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
props := sprops.Prop[i]
name := st.Field(i).Name
+ if name == "XXX_NoUnkeyedLiteral" {
+ continue
+ }
+
if strings.HasPrefix(name, "XXX_") {
// There are two XXX_ fields:
// XXX_unrecognized []byte
@@ -436,12 +434,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return err
}
}
- if b, ok := fv.Interface().(raw); ok {
- if err := writeRaw(w, b.Bytes()); err != nil {
- return err
- }
- continue
- }
// Enums have a String method, so writeAny will work fine.
if err := tm.writeAny(w, fv, props); err != nil {
@@ -455,7 +447,7 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
// Extensions (the XXX_extensions field).
pv := sv.Addr()
- if _, ok := extendable(pv.Interface()); ok {
+ if _, err := extendable(pv.Interface()); err == nil {
if err := tm.writeExtensions(w, pv); err != nil {
return err
}
@@ -464,27 +456,6 @@ func (tm *TextMarshaler) writeStruct(w *textWriter, sv reflect.Value) error {
return nil
}
-// writeRaw writes an uninterpreted raw message.
-func writeRaw(w *textWriter, b []byte) error {
- if err := w.WriteByte('<'); err != nil {
- return err
- }
- if !w.compact {
- if err := w.WriteByte('\n'); err != nil {
- return err
- }
- }
- w.indent()
- if err := writeUnknownStruct(w, b); err != nil {
- return err
- }
- w.unindent()
- if err := w.WriteByte('>'); err != nil {
- return err
- }
- return nil
-}
-
// writeAny writes an arbitrary field.
func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Properties) error {
v = reflect.Indirect(v)
@@ -535,6 +506,19 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
}
}
w.indent()
+ if v.CanAddr() {
+ // Calling v.Interface on a struct causes the reflect package to
+ // copy the entire struct. This is racy with the new Marshaler
+ // since we atomically update the XXX_sizecache.
+ //
+ // Thus, we retrieve a pointer to the struct if possible to avoid
+ // a race since v.Interface on the pointer doesn't copy the struct.
+ //
+ // If v is not addressable, then we are not worried about a race
+ // since it implies that the binary Marshaler cannot possibly be
+ // mutating this value.
+ v = v.Addr()
+ }
if etm, ok := v.Interface().(encoding.TextMarshaler); ok {
text, err := etm.MarshalText()
if err != nil {
@@ -543,8 +527,13 @@ func (tm *TextMarshaler) writeAny(w *textWriter, v reflect.Value, props *Propert
if _, err = w.Write(text); err != nil {
return err
}
- } else if err := tm.writeStruct(w, v); err != nil {
- return err
+ } else {
+ if v.Kind() == reflect.Ptr {
+ v = v.Elem()
+ }
+ if err := tm.writeStruct(w, v); err != nil {
+ return err
+ }
}
w.unindent()
if err := w.WriteByte(ket); err != nil {
diff --git a/vendor/github.com/golang/protobuf/proto/text_parser.go b/vendor/github.com/golang/protobuf/proto/text_parser.go
index 5e14513f2..0685bae36 100644
--- a/vendor/github.com/golang/protobuf/proto/text_parser.go
+++ b/vendor/github.com/golang/protobuf/proto/text_parser.go
@@ -206,7 +206,6 @@ func (p *textParser) advance() {
var (
errBadUTF8 = errors.New("proto: bad UTF-8")
- errBadHex = errors.New("proto: bad hexadecimal")
)
func unquoteC(s string, quote rune) (string, error) {
@@ -277,60 +276,47 @@ func unescape(s string) (ch string, tail string, err error) {
return "?", s, nil // trigraph workaround
case '\'', '"', '\\':
return string(r), s, nil
- case '0', '1', '2', '3', '4', '5', '6', '7', 'x', 'X':
+ case '0', '1', '2', '3', '4', '5', '6', '7':
if len(s) < 2 {
return "", "", fmt.Errorf(`\%c requires 2 following digits`, r)
}
- base := 8
- ss := s[:2]
+ ss := string(r) + s[:2]
s = s[2:]
- if r == 'x' || r == 'X' {
- base = 16
- } else {
- ss = string(r) + ss
- }
- i, err := strconv.ParseUint(ss, base, 8)
+ i, err := strconv.ParseUint(ss, 8, 8)
if err != nil {
- return "", "", err
+ return "", "", fmt.Errorf(`\%s contains non-octal digits`, ss)
}
return string([]byte{byte(i)}), s, nil
- case 'u', 'U':
- n := 4
- if r == 'U' {
+ case 'x', 'X', 'u', 'U':
+ var n int
+ switch r {
+ case 'x', 'X':
+ n = 2
+ case 'u':
+ n = 4
+ case 'U':
n = 8
}
if len(s) < n {
- return "", "", fmt.Errorf(`\%c requires %d digits`, r, n)
- }
-
- bs := make([]byte, n/2)
- for i := 0; i < n; i += 2 {
- a, ok1 := unhex(s[i])
- b, ok2 := unhex(s[i+1])
- if !ok1 || !ok2 {
- return "", "", errBadHex
- }
- bs[i/2] = a<<4 | b
+ return "", "", fmt.Errorf(`\%c requires %d following digits`, r, n)
}
+ ss := s[:n]
s = s[n:]
- return string(bs), s, nil
+ i, err := strconv.ParseUint(ss, 16, 64)
+ if err != nil {
+ return "", "", fmt.Errorf(`\%c%s contains non-hexadecimal digits`, r, ss)
+ }
+ if r == 'x' || r == 'X' {
+ return string([]byte{byte(i)}), s, nil
+ }
+ if i > utf8.MaxRune {
+ return "", "", fmt.Errorf(`\%c%s is not a valid Unicode code point`, r, ss)
+ }
+ return string(i), s, nil
}
return "", "", fmt.Errorf(`unknown escape \%c`, r)
}
-// Adapted from src/pkg/strconv/quote.go.
-func unhex(b byte) (v byte, ok bool) {
- switch {
- case '0' <= b && b <= '9':
- return b - '0', true
- case 'a' <= b && b <= 'f':
- return b - 'a' + 10, true
- case 'A' <= b && b <= 'F':
- return b - 'A' + 10, true
- }
- return 0, false
-}
-
// Back off the parser by one token. Can only be done between calls to next().
// It makes the next advance() a no-op.
func (p *textParser) back() { p.backed = true }
@@ -728,6 +714,9 @@ func (p *textParser) consumeExtName() (string, error) {
if tok.err != nil {
return "", p.errorf("unrecognized type_url or extension name: %s", tok.err)
}
+ if p.done && tok.value != "]" {
+ return "", p.errorf("unclosed type_url or extension name")
+ }
}
return strings.Join(parts, ""), nil
}
@@ -865,7 +854,7 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
return p.readStruct(fv, terminator)
case reflect.Uint32:
if x, err := strconv.ParseUint(tok.value, 0, 32); err == nil {
- fv.SetUint(x)
+ fv.SetUint(uint64(x))
return nil
}
case reflect.Uint64:
@@ -883,13 +872,9 @@ func (p *textParser) readAny(v reflect.Value, props *Properties) error {
// UnmarshalText returns *RequiredNotSetError.
func UnmarshalText(s string, pb Message) error {
if um, ok := pb.(encoding.TextUnmarshaler); ok {
- err := um.UnmarshalText([]byte(s))
- return err
+ return um.UnmarshalText([]byte(s))
}
pb.Reset()
v := reflect.ValueOf(pb)
- if pe := newTextParser(s).readStruct(v.Elem(), ""); pe != nil {
- return pe
- }
- return nil
+ return newTextParser(s).readStruct(v.Elem(), "")
}
diff --git a/vendor/github.com/gorilla/context/.travis.yml b/vendor/github.com/gorilla/context/.travis.yml
index faca4dad3..6f440f1e4 100644
--- a/vendor/github.com/gorilla/context/.travis.yml
+++ b/vendor/github.com/gorilla/context/.travis.yml
@@ -7,13 +7,13 @@ matrix:
- go: 1.4
- go: 1.5
- go: 1.6
+ - go: 1.7
+ - go: tip
+ allow_failures:
- go: tip
-
-install:
- - go get golang.org/x/tools/cmd/vet
script:
- go get -t -v ./...
- diff -u <(echo -n) <(gofmt -d .)
- - go tool vet .
+ - go vet $(go list ./... | grep -v /vendor/)
- go test -v -race ./...
diff --git a/vendor/github.com/gorilla/context/README.md b/vendor/github.com/gorilla/context/README.md
index c60a31b05..08f86693b 100644
--- a/vendor/github.com/gorilla/context/README.md
+++ b/vendor/github.com/gorilla/context/README.md
@@ -4,4 +4,7 @@ context
gorilla/context is a general purpose registry for global request variables.
+> Note: gorilla/context, having been born well before `context.Context` existed, does not play well
+> with the shallow copying of the request that [`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext) (added to net/http Go 1.7 onwards) performs. You should either use *just* gorilla/context, or moving forward, the new `http.Request.Context()`.
+
Read the full documentation here: http://www.gorillatoolkit.org/pkg/context
diff --git a/vendor/github.com/gorilla/context/doc.go b/vendor/github.com/gorilla/context/doc.go
index 73c740031..448d1bfca 100644
--- a/vendor/github.com/gorilla/context/doc.go
+++ b/vendor/github.com/gorilla/context/doc.go
@@ -5,6 +5,12 @@
/*
Package context stores values shared during a request lifetime.
+Note: gorilla/context, having been born well before `context.Context` existed,
+does not play well > with the shallow copying of the request that
+[`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext)
+(added to net/http Go 1.7 onwards) performs. You should either use *just*
+gorilla/context, or moving forward, the new `http.Request.Context()`.
+
For example, a router can set variables extracted from the URL and later
application handlers can access those values, or it can be used to store
sessions values to be saved at the end of a request. There are several
diff --git a/vendor/github.com/gorilla/mux/.travis.yml b/vendor/github.com/gorilla/mux/.travis.yml
index 3302233f3..ad0935dbd 100644
--- a/vendor/github.com/gorilla/mux/.travis.yml
+++ b/vendor/github.com/gorilla/mux/.travis.yml
@@ -3,11 +3,12 @@ sudo: false
matrix:
include:
- - go: 1.5
- - go: 1.6
- - go: 1.7
- - go: 1.8
- - go: 1.9
+ - go: 1.5.x
+ - go: 1.6.x
+ - go: 1.7.x
+ - go: 1.8.x
+ - go: 1.9.x
+ - go: 1.10.x
- go: tip
allow_failures:
- go: tip
diff --git a/vendor/github.com/gorilla/mux/README.md b/vendor/github.com/gorilla/mux/README.md
index f9b3103f0..e424397ac 100644
--- a/vendor/github.com/gorilla/mux/README.md
+++ b/vendor/github.com/gorilla/mux/README.md
@@ -1,5 +1,5 @@
-gorilla/mux
-===
+# gorilla/mux
+
[![GoDoc](https://godoc.org/github.com/gorilla/mux?status.svg)](https://godoc.org/github.com/gorilla/mux)
[![Build Status](https://travis-ci.org/gorilla/mux.svg?branch=master)](https://travis-ci.org/gorilla/mux)
[![Sourcegraph](https://sourcegraph.com/github.com/gorilla/mux/-/badge.svg)](https://sourcegraph.com/github.com/gorilla/mux?badge)
@@ -29,6 +29,7 @@ The name mux stands for "HTTP request multiplexer". Like the standard `http.Serv
* [Walking Routes](#walking-routes)
* [Graceful Shutdown](#graceful-shutdown)
* [Middleware](#middleware)
+* [Testing Handlers](#testing-handlers)
* [Full Example](#full-example)
---
@@ -178,70 +179,13 @@ s.HandleFunc("/{key}/", ProductHandler)
// "/products/{key}/details"
s.HandleFunc("/{key}/details", ProductDetailsHandler)
```
-### Listing Routes
-
-Routes on a mux can be listed using the Router.Walk method—useful for generating documentation:
-
-```go
-package main
-
-import (
- "fmt"
- "net/http"
- "strings"
-
- "github.com/gorilla/mux"
-)
-
-func handler(w http.ResponseWriter, r *http.Request) {
- return
-}
-func main() {
- r := mux.NewRouter()
- r.HandleFunc("/", handler)
- r.HandleFunc("/products", handler).Methods("POST")
- r.HandleFunc("/articles", handler).Methods("GET")
- r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT")
- r.HandleFunc("/authors", handler).Queries("surname", "{surname}")
- r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
- t, err := route.GetPathTemplate()
- if err != nil {
- return err
- }
- qt, err := route.GetQueriesTemplates()
- if err != nil {
- return err
- }
- // p will contain regular expression is compatible with regular expression in Perl, Python, and other languages.
- // for instance the regular expression for path '/articles/{id}' will be '^/articles/(?P<v0>[^/]+)$'
- p, err := route.GetPathRegexp()
- if err != nil {
- return err
- }
- // qr will contain a list of regular expressions with the same semantics as GetPathRegexp,
- // just applied to the Queries pairs instead, e.g., 'Queries("surname", "{surname}") will return
- // {"^surname=(?P<v0>.*)$}. Where each combined query pair will have an entry in the list.
- qr, err := route.GetQueriesRegexp()
- if err != nil {
- return err
- }
- m, err := route.GetMethods()
- if err != nil {
- return err
- }
- fmt.Println(strings.Join(m, ","), strings.Join(qt, ","), strings.Join(qr, ","), t, p)
- return nil
- })
- http.Handle("/", r)
-}
-```
### Static Files
Note that the path provided to `PathPrefix()` represents a "wildcard": calling
`PathPrefix("/static/").Handler(...)` means that the handler will be passed any
-request that matches "/static/*". This makes it easy to serve static files with mux:
+request that matches "/static/\*". This makes it easy to serve static files with mux:
```go
func main() {
@@ -348,41 +292,58 @@ The `Walk` function on `mux.Router` can be used to visit all of the routes that
the following prints all of the registered routes:
```go
-r := mux.NewRouter()
-r.HandleFunc("/", handler)
-r.HandleFunc("/products", handler).Methods("POST")
-r.HandleFunc("/articles", handler).Methods("GET")
-r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT")
-r.HandleFunc("/authors", handler).Queries("surname", "{surname}")
-r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
- t, err := route.GetPathTemplate()
- if err != nil {
- return err
- }
- qt, err := route.GetQueriesTemplates()
- if err != nil {
- return err
- }
- // p will contain a regular expression that is compatible with regular expressions in Perl, Python, and other languages.
- // For example, the regular expression for path '/articles/{id}' will be '^/articles/(?P<v0>[^/]+)$'.
- p, err := route.GetPathRegexp()
- if err != nil {
- return err
- }
- // qr will contain a list of regular expressions with the same semantics as GetPathRegexp,
- // just applied to the Queries pairs instead, e.g., 'Queries("surname", "{surname}") will return
- // {"^surname=(?P<v0>.*)$}. Where each combined query pair will have an entry in the list.
- qr, err := route.GetQueriesRegexp()
- if err != nil {
- return err
- }
- m, err := route.GetMethods()
- if err != nil {
- return err
- }
- fmt.Println(strings.Join(m, ","), strings.Join(qt, ","), strings.Join(qr, ","), t, p)
- return nil
-})
+package main
+
+import (
+ "fmt"
+ "net/http"
+ "strings"
+
+ "github.com/gorilla/mux"
+)
+
+func handler(w http.ResponseWriter, r *http.Request) {
+ return
+}
+
+func main() {
+ r := mux.NewRouter()
+ r.HandleFunc("/", handler)
+ r.HandleFunc("/products", handler).Methods("POST")
+ r.HandleFunc("/articles", handler).Methods("GET")
+ r.HandleFunc("/articles/{id}", handler).Methods("GET", "PUT")
+ r.HandleFunc("/authors", handler).Queries("surname", "{surname}")
+ err := r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
+ pathTemplate, err := route.GetPathTemplate()
+ if err == nil {
+ fmt.Println("ROUTE:", pathTemplate)
+ }
+ pathRegexp, err := route.GetPathRegexp()
+ if err == nil {
+ fmt.Println("Path regexp:", pathRegexp)
+ }
+ queriesTemplates, err := route.GetQueriesTemplates()
+ if err == nil {
+ fmt.Println("Queries templates:", strings.Join(queriesTemplates, ","))
+ }
+ queriesRegexps, err := route.GetQueriesRegexp()
+ if err == nil {
+ fmt.Println("Queries regexps:", strings.Join(queriesRegexps, ","))
+ }
+ methods, err := route.GetMethods()
+ if err == nil {
+ fmt.Println("Methods:", strings.Join(methods, ","))
+ }
+ fmt.Println()
+ return nil
+ })
+
+ if err != nil {
+ fmt.Println(err)
+ }
+
+ http.Handle("/", r)
+}
```
### Graceful Shutdown
@@ -399,6 +360,7 @@ import (
"net/http"
"os"
"os/signal"
+ "time"
"github.com/gorilla/mux"
)
@@ -410,7 +372,7 @@ func main() {
r := mux.NewRouter()
// Add your routes as needed
-
+
srv := &http.Server{
Addr: "0.0.0.0:8080",
// Good practice to set timeouts to avoid Slowloris attacks.
@@ -426,7 +388,7 @@ func main() {
log.Println(err)
}
}()
-
+
c := make(chan os.Signal, 1)
// We'll accept graceful shutdowns when quit via SIGINT (Ctrl+C)
// SIGKILL, SIGQUIT or SIGTERM (Ctrl+/) will not be caught.
@@ -436,7 +398,8 @@ func main() {
<-c
// Create a deadline to wait for.
- ctx, cancel := context.WithTimeout(ctx, wait)
+ ctx, cancel := context.WithTimeout(context.Background(), wait)
+ defer cancel()
// Doesn't block if no connections, but will otherwise wait
// until the timeout deadline.
srv.Shutdown(ctx)
@@ -464,7 +427,7 @@ Typically, the returned handler is a closure which does something with the http.
A very basic middleware which logs the URI of the request being handled could be written as:
```go
-func simpleMw(next http.Handler) http.Handler {
+func loggingMiddleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Do stuff here
log.Println(r.RequestURI)
@@ -474,12 +437,12 @@ func simpleMw(next http.Handler) http.Handler {
}
```
-Middlewares can be added to a router using `Router.AddMiddlewareFunc()`:
+Middlewares can be added to a router using `Router.Use()`:
```go
r := mux.NewRouter()
r.HandleFunc("/", handler)
-r.AddMiddleware(simpleMw)
+r.Use(loggingMiddleware)
```
A more complex authentication middleware, which maps session token to users, could be written as:
@@ -502,7 +465,7 @@ func (amw *authenticationMiddleware) Populate() {
func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
token := r.Header.Get("X-Session-Token")
-
+
if user, found := amw.tokenUsers[token]; found {
// We found the token in our map
log.Printf("Authenticated user %s\n", user)
@@ -510,7 +473,7 @@ func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler
next.ServeHTTP(w, r)
} else {
// Write an error and stop the handler chain
- http.Error(w, "Forbidden", 403)
+ http.Error(w, "Forbidden", http.StatusForbidden)
}
})
}
@@ -523,10 +486,136 @@ r.HandleFunc("/", handler)
amw := authenticationMiddleware{}
amw.Populate()
-r.AddMiddlewareFunc(amw.Middleware)
+r.Use(amw.Middleware)
+```
+
+Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to. Middlewares _should_ write to `ResponseWriter` if they _are_ going to terminate the request, and they _should not_ write to `ResponseWriter` if they _are not_ going to terminate it.
+
+### Testing Handlers
+
+Testing handlers in a Go web application is straightforward, and _mux_ doesn't complicate this any further. Given two files: `endpoints.go` and `endpoints_test.go`, here's how we'd test an application using _mux_.
+
+First, our simple HTTP handler:
+
+```go
+// endpoints.go
+package main
+
+func HealthCheckHandler(w http.ResponseWriter, r *http.Request) {
+ // A very simple health check.
+ w.WriteHeader(http.StatusOK)
+ w.Header().Set("Content-Type", "application/json")
+
+ // In the future we could report back on the status of our DB, or our cache
+ // (e.g. Redis) by performing a simple PING, and include them in the response.
+ io.WriteString(w, `{"alive": true}`)
+}
+
+func main() {
+ r := mux.NewRouter()
+ r.HandleFunc("/health", HealthCheckHandler)
+
+ log.Fatal(http.ListenAndServe("localhost:8080", r))
+}
+```
+
+Our test code:
+
+```go
+// endpoints_test.go
+package main
+
+import (
+ "net/http"
+ "net/http/httptest"
+ "testing"
+)
+
+func TestHealthCheckHandler(t *testing.T) {
+ // Create a request to pass to our handler. We don't have any query parameters for now, so we'll
+ // pass 'nil' as the third parameter.
+ req, err := http.NewRequest("GET", "/health", nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ // We create a ResponseRecorder (which satisfies http.ResponseWriter) to record the response.
+ rr := httptest.NewRecorder()
+ handler := http.HandlerFunc(HealthCheckHandler)
+
+ // Our handlers satisfy http.Handler, so we can call their ServeHTTP method
+ // directly and pass in our Request and ResponseRecorder.
+ handler.ServeHTTP(rr, req)
+
+ // Check the status code is what we expect.
+ if status := rr.Code; status != http.StatusOK {
+ t.Errorf("handler returned wrong status code: got %v want %v",
+ status, http.StatusOK)
+ }
+
+ // Check the response body is what we expect.
+ expected := `{"alive": true}`
+ if rr.Body.String() != expected {
+ t.Errorf("handler returned unexpected body: got %v want %v",
+ rr.Body.String(), expected)
+ }
+}
+```
+
+In the case that our routes have [variables](#examples), we can pass those in the request. We could write
+[table-driven tests](https://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go) to test multiple
+possible route variables as needed.
+
+```go
+// endpoints.go
+func main() {
+ r := mux.NewRouter()
+ // A route with a route variable:
+ r.HandleFunc("/metrics/{type}", MetricsHandler)
+
+ log.Fatal(http.ListenAndServe("localhost:8080", r))
+}
```
-Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to. Middlewares *should* write to `ResponseWriter` if they *are* going to terminate the request, and they *should not* write to `ResponseWriter` if they *are not* going to terminate it.
+Our test file, with a table-driven test of `routeVariables`:
+
+```go
+// endpoints_test.go
+func TestMetricsHandler(t *testing.T) {
+ tt := []struct{
+ routeVariable string
+ shouldPass bool
+ }{
+ {"goroutines", true},
+ {"heap", true},
+ {"counters", true},
+ {"queries", true},
+ {"adhadaeqm3k", false},
+ }
+
+ for _, tc := range tt {
+ path := fmt.Sprintf("/metrics/%s", tc.routeVariable)
+ req, err := http.NewRequest("GET", path, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ rr := httptest.NewRecorder()
+
+ // Need to create a router that we can pass the request through so that the vars will be added to the context
+ router := mux.NewRouter()
+ router.HandleFunc("/metrics/{type}", MetricsHandler)
+ router.ServeHTTP(rr, req)
+
+ // In this case, our MetricsHandler returns a non-200 response
+ // for a route variable it doesn't know about.
+ if rr.Code == http.StatusOK && !tc.shouldPass {
+ t.Errorf("handler should have failed on routeVariable %s: got %v want %v",
+ tc.routeVariable, rr.Code, http.StatusOK)
+ }
+ }
+}
+```
## Full Example
diff --git a/vendor/github.com/gorilla/mux/doc.go b/vendor/github.com/gorilla/mux/doc.go
index 013f08898..38957deea 100644
--- a/vendor/github.com/gorilla/mux/doc.go
+++ b/vendor/github.com/gorilla/mux/doc.go
@@ -239,8 +239,7 @@ as well:
"category", "technology",
"id", "42")
-Since **vX.Y.Z**, mux supports the addition of middlewares to a [Router](https://godoc.org/github.com/gorilla/mux#Router), which are executed if a
-match is found (including subrouters). Middlewares are defined using the de facto standard type:
+Mux supports the addition of middlewares to a Router, which are executed in the order they are added if a match is found, including its subrouters. Middlewares are (typically) small pieces of code which take one request, do something with it, and pass it down to another middleware or the final handler. Some common use cases for middleware are request logging, header manipulation, or ResponseWriter hijacking.
type MiddlewareFunc func(http.Handler) http.Handler
@@ -261,7 +260,7 @@ Middlewares can be added to a router using `Router.Use()`:
r := mux.NewRouter()
r.HandleFunc("/", handler)
- r.AddMiddleware(simpleMw)
+ r.Use(simpleMw)
A more complex authentication middleware, which maps session token to users, could be written as:
@@ -288,7 +287,7 @@ A more complex authentication middleware, which maps session token to users, cou
log.Printf("Authenticated user %s\n", user)
next.ServeHTTP(w, r)
} else {
- http.Error(w, "Forbidden", 403)
+ http.Error(w, "Forbidden", http.StatusForbidden)
}
})
}
diff --git a/vendor/github.com/gorilla/mux/middleware.go b/vendor/github.com/gorilla/mux/middleware.go
index 8f898675e..ceb812cee 100644
--- a/vendor/github.com/gorilla/mux/middleware.go
+++ b/vendor/github.com/gorilla/mux/middleware.go
@@ -1,6 +1,9 @@
package mux
-import "net/http"
+import (
+ "net/http"
+ "strings"
+)
// MiddlewareFunc is a function which receives an http.Handler and returns another http.Handler.
// Typically, the returned handler is a closure which does something with the http.ResponseWriter and http.Request passed
@@ -12,17 +15,58 @@ type middleware interface {
Middleware(handler http.Handler) http.Handler
}
-// MiddlewareFunc also implements the middleware interface.
+// Middleware allows MiddlewareFunc to implement the middleware interface.
func (mw MiddlewareFunc) Middleware(handler http.Handler) http.Handler {
return mw(handler)
}
// Use appends a MiddlewareFunc to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router.
-func (r *Router) Use(mwf MiddlewareFunc) {
- r.middlewares = append(r.middlewares, mwf)
+func (r *Router) Use(mwf ...MiddlewareFunc) {
+ for _, fn := range mwf {
+ r.middlewares = append(r.middlewares, fn)
+ }
}
// useInterface appends a middleware to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router.
func (r *Router) useInterface(mw middleware) {
r.middlewares = append(r.middlewares, mw)
}
+
+// CORSMethodMiddleware sets the Access-Control-Allow-Methods response header
+// on a request, by matching routes based only on paths. It also handles
+// OPTIONS requests, by settings Access-Control-Allow-Methods, and then
+// returning without calling the next http handler.
+func CORSMethodMiddleware(r *Router) MiddlewareFunc {
+ return func(next http.Handler) http.Handler {
+ return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
+ var allMethods []string
+
+ err := r.Walk(func(route *Route, _ *Router, _ []*Route) error {
+ for _, m := range route.matchers {
+ if _, ok := m.(*routeRegexp); ok {
+ if m.Match(req, &RouteMatch{}) {
+ methods, err := route.GetMethods()
+ if err != nil {
+ return err
+ }
+
+ allMethods = append(allMethods, methods...)
+ }
+ break
+ }
+ }
+ return nil
+ })
+
+ if err == nil {
+ w.Header().Set("Access-Control-Allow-Methods", strings.Join(append(allMethods, "OPTIONS"), ","))
+
+ if req.Method == "OPTIONS" {
+ return
+ }
+ }
+
+ next.ServeHTTP(w, req)
+ })
+ }
+}
diff --git a/vendor/github.com/gorilla/mux/mux.go b/vendor/github.com/gorilla/mux/mux.go
index efabd2417..4bbafa51d 100644
--- a/vendor/github.com/gorilla/mux/mux.go
+++ b/vendor/github.com/gorilla/mux/mux.go
@@ -13,8 +13,11 @@ import (
)
var (
+ // ErrMethodMismatch is returned when the method in the request does not match
+ // the method defined against the route.
ErrMethodMismatch = errors.New("method is not allowed")
- ErrNotFound = errors.New("no matching route was found")
+ // ErrNotFound is returned when no route match is found.
+ ErrNotFound = errors.New("no matching route was found")
)
// NewRouter returns a new router instance.
@@ -95,9 +98,9 @@ func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
if r.MethodNotAllowedHandler != nil {
match.Handler = r.MethodNotAllowedHandler
return true
- } else {
- return false
}
+
+ return false
}
// Closest match for a router (includes sub-routers)
diff --git a/vendor/github.com/gorilla/mux/route.go b/vendor/github.com/gorilla/mux/route.go
index 4ce098d4f..a591d7354 100644
--- a/vendor/github.com/gorilla/mux/route.go
+++ b/vendor/github.com/gorilla/mux/route.go
@@ -43,6 +43,8 @@ type Route struct {
buildVarsFunc BuildVarsFunc
}
+// SkipClean reports whether path cleaning is enabled for this route via
+// Router.SkipClean.
func (r *Route) SkipClean() bool {
return r.skipClean
}
@@ -622,7 +624,7 @@ func (r *Route) GetPathRegexp() (string, error) {
// route queries.
// This is useful for building simple REST API documentation and for instrumentation
// against third-party services.
-// An empty list will be returned if the route does not have queries.
+// An error will be returned if the route does not have queries.
func (r *Route) GetQueriesRegexp() ([]string, error) {
if r.err != nil {
return nil, r.err
@@ -641,7 +643,7 @@ func (r *Route) GetQueriesRegexp() ([]string, error) {
// query matching.
// This is useful for building simple REST API documentation and for instrumentation
// against third-party services.
-// An empty list will be returned if the route does not define queries.
+// An error will be returned if the route does not define queries.
func (r *Route) GetQueriesTemplates() ([]string, error) {
if r.err != nil {
return nil, r.err
@@ -659,7 +661,7 @@ func (r *Route) GetQueriesTemplates() ([]string, error) {
// GetMethods returns the methods the route matches against
// This is useful for building simple REST API documentation and for instrumentation
// against third-party services.
-// An empty list will be returned if route does not have methods.
+// An error will be returned if route does not have methods.
func (r *Route) GetMethods() ([]string, error) {
if r.err != nil {
return nil, r.err
@@ -669,7 +671,7 @@ func (r *Route) GetMethods() ([]string, error) {
return []string(methods), nil
}
}
- return nil, nil
+ return nil, errors.New("mux: route doesn't have methods")
}
// GetHostTemplate returns the template used to build the
diff --git a/vendor/github.com/gorilla/mux/test_helpers.go b/vendor/github.com/gorilla/mux/test_helpers.go
index 8b2c4a4c5..32ecffde4 100644
--- a/vendor/github.com/gorilla/mux/test_helpers.go
+++ b/vendor/github.com/gorilla/mux/test_helpers.go
@@ -7,7 +7,8 @@ package mux
import "net/http"
// SetURLVars sets the URL variables for the given request, to be accessed via
-// mux.Vars for testing route behaviour.
+// mux.Vars for testing route behaviour. Arguments are not modified, a shallow
+// copy is returned.
//
// This API should only be used for testing purposes; it provides a way to
// inject variables into the request context. Alternatively, URL variables
diff --git a/vendor/github.com/gorilla/websocket/client.go b/vendor/github.com/gorilla/websocket/client.go
index 8e90de27f..41f8ed53d 100644
--- a/vendor/github.com/gorilla/websocket/client.go
+++ b/vendor/github.com/gorilla/websocket/client.go
@@ -201,7 +201,7 @@ func (d *Dialer) Dial(urlStr string, requestHeader http.Header) (*Conn, *http.Re
}
if d.EnableCompression {
- req.Header.Set("Sec-Websocket-Extensions", "permessage-deflate; server_no_context_takeover; client_no_context_takeover")
+ req.Header["Sec-WebSocket-Extensions"] = []string{"permessage-deflate; server_no_context_takeover; client_no_context_takeover"}
}
var deadline time.Time
diff --git a/vendor/github.com/gorilla/websocket/proxy.go b/vendor/github.com/gorilla/websocket/proxy.go
index 102538bd3..bf2478e43 100644
--- a/vendor/github.com/gorilla/websocket/proxy.go
+++ b/vendor/github.com/gorilla/websocket/proxy.go
@@ -14,7 +14,7 @@ import (
"strings"
)
-type netDialerFunc func(netowrk, addr string) (net.Conn, error)
+type netDialerFunc func(network, addr string) (net.Conn, error)
func (fn netDialerFunc) Dial(network, addr string) (net.Conn, error) {
return fn(network, addr)
diff --git a/vendor/github.com/gorilla/websocket/server.go b/vendor/github.com/gorilla/websocket/server.go
index 3e96a00c8..aee270528 100644
--- a/vendor/github.com/gorilla/websocket/server.go
+++ b/vendor/github.com/gorilla/websocket/server.go
@@ -103,7 +103,7 @@ func (u *Upgrader) selectSubprotocol(r *http.Request, responseHeader http.Header
//
// The responseHeader is included in the response to the client's upgrade
// request. Use the responseHeader to specify cookies (Set-Cookie) and the
-// application negotiated subprotocol (Sec-Websocket-Protocol).
+// application negotiated subprotocol (Sec-WebSocket-Protocol).
//
// If the upgrade fails, then Upgrade replies to the client with an HTTP error
// response.
@@ -127,7 +127,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
}
if _, ok := responseHeader["Sec-Websocket-Extensions"]; ok {
- return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-Websocket-Extensions' headers are unsupported")
+ return u.returnError(w, r, http.StatusInternalServerError, "websocket: application specific 'Sec-WebSocket-Extensions' headers are unsupported")
}
checkOrigin := u.CheckOrigin
@@ -140,7 +140,7 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
challengeKey := r.Header.Get("Sec-Websocket-Key")
if challengeKey == "" {
- return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: `Sec-Websocket-Key' header is missing or blank")
+ return u.returnError(w, r, http.StatusBadRequest, "websocket: not a websocket handshake: `Sec-WebSocket-Key' header is missing or blank")
}
subprotocol := u.selectSubprotocol(r, responseHeader)
@@ -190,12 +190,12 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
p = append(p, computeAcceptKey(challengeKey)...)
p = append(p, "\r\n"...)
if c.subprotocol != "" {
- p = append(p, "Sec-Websocket-Protocol: "...)
+ p = append(p, "Sec-WebSocket-Protocol: "...)
p = append(p, c.subprotocol...)
p = append(p, "\r\n"...)
}
if compress {
- p = append(p, "Sec-Websocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...)
+ p = append(p, "Sec-WebSocket-Extensions: permessage-deflate; server_no_context_takeover; client_no_context_takeover\r\n"...)
}
for k, vs := range responseHeader {
if k == "Sec-Websocket-Protocol" {
diff --git a/vendor/github.com/hako/durafmt/README.md b/vendor/github.com/hako/durafmt/README.md
index 128819282..6b26faaf3 100644
--- a/vendor/github.com/hako/durafmt/README.md
+++ b/vendor/github.com/hako/durafmt/README.md
@@ -33,7 +33,7 @@ The above seems very easy to read, unless your duration looks like this:
package main
import (
- "fmt"
+ "fmt"
"github.com/hako/durafmt"
)
@@ -47,6 +47,28 @@ func main() {
}
```
+### durafmt.ParseStringShort()
+
+Version of `durafmt.ParseString()` that only returns the first part of the duration string.
+
+```go
+package main
+
+import (
+ "fmt"
+ "github.com/hako/durafmt"
+)
+
+func main() {
+ duration, err := durafmt.ParseStringShort("354h22m3.24s")
+ if err != nil {
+ fmt.Println(err)
+ }
+ fmt.Println(duration) // 2 weeks
+ // duration.String() // String short representation. "2 weeks"
+}
+```
+
### durafmt.Parse()
```go
@@ -65,6 +87,26 @@ func main() {
}
```
+### durafmt.ParseShort()
+
+Version of `durafmt.Parse()` that only returns the first part of the duration string.
+
+```go
+package main
+
+import (
+ "fmt"
+ "time"
+ "github.com/hako/durafmt"
+)
+
+func main() {
+ timeduration := (354 * time.Hour) + (22 * time.Minute) + (3 * time.Second)
+ duration := durafmt.ParseShort(timeduration).String()
+ fmt.Println(duration) // 2 weeks
+}
+```
+
# Contributing
Contributions are welcome! Fork this repo and add your changes and submit a PR.
diff --git a/vendor/github.com/hako/durafmt/durafmt.go b/vendor/github.com/hako/durafmt/durafmt.go
index a7e0a48c2..730237d57 100644
--- a/vendor/github.com/hako/durafmt/durafmt.go
+++ b/vendor/github.com/hako/durafmt/durafmt.go
@@ -16,12 +16,19 @@ var (
type Durafmt struct {
duration time.Duration
input string // Used as reference.
+ short bool
}
// Parse creates a new *Durafmt struct, returns error if input is invalid.
func Parse(dinput time.Duration) *Durafmt {
input := dinput.String()
- return &Durafmt{dinput, input}
+ return &Durafmt{dinput, input, false}
+}
+
+// ParseShort creates a new *Durafmt struct, short form, returns error if input is invalid.
+func ParseShort(dinput time.Duration) *Durafmt {
+ input := dinput.String()
+ return &Durafmt{dinput, input, true}
}
// ParseString creates a new *Durafmt struct from a string.
@@ -34,7 +41,20 @@ func ParseString(input string) (*Durafmt, error) {
if err != nil {
return nil, err
}
- return &Durafmt{duration, input}, nil
+ return &Durafmt{duration, input, false}, nil
+}
+
+// ParseStringShort creates a new *Durafmt struct from a string, short form
+// returns an error if input is invalid.
+func ParseStringShort(input string) (*Durafmt, error) {
+ if input == "0" || input == "-0" {
+ return nil, errors.New("durafmt: missing unit in duration " + input)
+ }
+ duration, err := time.ParseDuration(input)
+ if err != nil {
+ return nil, err
+ }
+ return &Durafmt{duration, input, true}, nil
}
// String parses d *Durafmt into a human readable duration.
@@ -116,5 +136,12 @@ func (d *Durafmt) String() string {
}
// trim any remaining spaces.
duration = strings.TrimSpace(duration)
+
+ // if more than 2 spaces present return the first 2 strings
+ // if short version is requested
+ if d.short {
+ duration = strings.Join(strings.Split(duration, " ")[:2], " ")
+ }
+
return duration
}
diff --git a/vendor/github.com/magiconair/properties/.travis.yml b/vendor/github.com/magiconair/properties/.travis.yml
index ab9803902..3e7c3d2c8 100644
--- a/vendor/github.com/magiconair/properties/.travis.yml
+++ b/vendor/github.com/magiconair/properties/.travis.yml
@@ -6,4 +6,5 @@ go:
- 1.7.x
- 1.8.x
- 1.9.x
+ - "1.10.x"
- tip
diff --git a/vendor/github.com/magiconair/properties/CHANGELOG.md b/vendor/github.com/magiconair/properties/CHANGELOG.md
index adefa17e8..f83adc205 100644
--- a/vendor/github.com/magiconair/properties/CHANGELOG.md
+++ b/vendor/github.com/magiconair/properties/CHANGELOG.md
@@ -1,5 +1,13 @@
## Changelog
+### [1.8](https://github.com/magiconair/properties/tree/v1.8) - 15 May 2018
+
+ * [PR #26](https://github.com/magiconair/properties/pull/26): Disable expansion during loading
+
+ This adds the option to disable property expansion during loading.
+
+ Thanks to [@kmala](https://github.com/kmala) for the patch.
+
### [1.7.6](https://github.com/magiconair/properties/tree/v1.7.6) - 14 Feb 2018
* [PR #29](https://github.com/magiconair/properties/pull/29): Reworked expansion logic to handle more complex cases.
diff --git a/vendor/github.com/magiconair/properties/README.md b/vendor/github.com/magiconair/properties/README.md
index 15dfde5cb..2c05f290f 100644
--- a/vendor/github.com/magiconair/properties/README.md
+++ b/vendor/github.com/magiconair/properties/README.md
@@ -1,5 +1,6 @@
[![](https://img.shields.io/github/tag/magiconair/properties.svg?style=flat-square&label=release)](https://github.com/magiconair/properties/releases)
-[![Build Status](https://img.shields.io/travis/magiconair/properties.svg?branch=master&style=flat-square)](https://travis-ci.org/magiconair/properties)
+[![Travis CI Status](https://img.shields.io/travis/magiconair/properties.svg?branch=master&style=flat-square&label=travis)](https://travis-ci.org/magiconair/properties)
+[![Codeship CI Status](https://img.shields.io/codeship/16aaf660-f615-0135-b8f0-7e33b70920c0/master.svg?label=codeship&style=flat-square)](https://app.codeship.com/projects/274177")
[![License](https://img.shields.io/badge/License-BSD%202--Clause-orange.svg?style=flat-square)](https://raw.githubusercontent.com/magiconair/properties/master/LICENSE)
[![GoDoc](http://img.shields.io/badge/godoc-reference-5272B4.svg?style=flat-square)](http://godoc.org/github.com/magiconair/properties)
diff --git a/vendor/github.com/magiconair/properties/decode.go b/vendor/github.com/magiconair/properties/decode.go
index 0a961bb04..3ebf8049c 100644
--- a/vendor/github.com/magiconair/properties/decode.go
+++ b/vendor/github.com/magiconair/properties/decode.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/doc.go b/vendor/github.com/magiconair/properties/doc.go
index 36c836808..f8822da2b 100644
--- a/vendor/github.com/magiconair/properties/doc.go
+++ b/vendor/github.com/magiconair/properties/doc.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -73,7 +73,7 @@
// # refers to the users' home dir
// home = ${HOME}
//
-// # local key takes precendence over env var: u = foo
+// # local key takes precedence over env var: u = foo
// USER = foo
// u = ${USER}
//
@@ -102,7 +102,7 @@
// v = p.GetString("key", "def")
// v = p.GetDuration("key", 999)
//
-// As an alterantive properties may be applied with the standard
+// As an alternative properties may be applied with the standard
// library's flag implementation at any time.
//
// # Standard configuration
diff --git a/vendor/github.com/magiconair/properties/integrate.go b/vendor/github.com/magiconair/properties/integrate.go
index 0d775e035..74d38dc67 100644
--- a/vendor/github.com/magiconair/properties/integrate.go
+++ b/vendor/github.com/magiconair/properties/integrate.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/lex.go b/vendor/github.com/magiconair/properties/lex.go
index c63fcc60d..367166d58 100644
--- a/vendor/github.com/magiconair/properties/lex.go
+++ b/vendor/github.com/magiconair/properties/lex.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
diff --git a/vendor/github.com/magiconair/properties/load.go b/vendor/github.com/magiconair/properties/load.go
index 9c83fd638..c8e1b5804 100644
--- a/vendor/github.com/magiconair/properties/load.go
+++ b/vendor/github.com/magiconair/properties/load.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -16,21 +16,157 @@ import (
type Encoding uint
const (
+ // utf8Default is a private placeholder for the zero value of Encoding to
+ // ensure that it has the correct meaning. UTF8 is the default encoding but
+ // was assigned a non-zero value which cannot be changed without breaking
+ // existing code. Clients should continue to use the public constants.
+ utf8Default Encoding = iota
+
// UTF8 interprets the input data as UTF-8.
- UTF8 Encoding = 1 << iota
+ UTF8
// ISO_8859_1 interprets the input data as ISO-8859-1.
ISO_8859_1
)
+type Loader struct {
+ // Encoding determines how the data from files and byte buffers
+ // is interpreted. For URLs the Content-Type header is used
+ // to determine the encoding of the data.
+ Encoding Encoding
+
+ // DisableExpansion configures the property expansion of the
+ // returned property object. When set to true, the property values
+ // will not be expanded and the Property object will not be checked
+ // for invalid expansion expressions.
+ DisableExpansion bool
+
+ // IgnoreMissing configures whether missing files or URLs which return
+ // 404 are reported as errors. When set to true, missing files and 404
+ // status codes are not reported as errors.
+ IgnoreMissing bool
+}
+
+// Load reads a buffer into a Properties struct.
+func (l *Loader) LoadBytes(buf []byte) (*Properties, error) {
+ return l.loadBytes(buf, l.Encoding)
+}
+
+// LoadAll reads the content of multiple URLs or files in the given order into
+// a Properties struct. If IgnoreMissing is true then a 404 status code or
+// missing file will not be reported as error. Encoding sets the encoding for
+// files. For the URLs see LoadURL for the Content-Type header and the
+// encoding.
+func (l *Loader) LoadAll(names []string) (*Properties, error) {
+ all := NewProperties()
+ for _, name := range names {
+ n, err := expandName(name)
+ if err != nil {
+ return nil, err
+ }
+
+ var p *Properties
+ switch {
+ case strings.HasPrefix(n, "http://"):
+ p, err = l.LoadURL(n)
+ case strings.HasPrefix(n, "https://"):
+ p, err = l.LoadURL(n)
+ default:
+ p, err = l.LoadFile(n)
+ }
+ if err != nil {
+ return nil, err
+ }
+ all.Merge(p)
+ }
+
+ all.DisableExpansion = l.DisableExpansion
+ if all.DisableExpansion {
+ return all, nil
+ }
+ return all, all.check()
+}
+
+// LoadFile reads a file into a Properties struct.
+// If IgnoreMissing is true then a missing file will not be
+// reported as error.
+func (l *Loader) LoadFile(filename string) (*Properties, error) {
+ data, err := ioutil.ReadFile(filename)
+ if err != nil {
+ if l.IgnoreMissing && os.IsNotExist(err) {
+ LogPrintf("properties: %s not found. skipping", filename)
+ return NewProperties(), nil
+ }
+ return nil, err
+ }
+ return l.loadBytes(data, l.Encoding)
+}
+
+// LoadURL reads the content of the URL into a Properties struct.
+//
+// The encoding is determined via the Content-Type header which
+// should be set to 'text/plain'. If the 'charset' parameter is
+// missing, 'iso-8859-1' or 'latin1' the encoding is set to
+// ISO-8859-1. If the 'charset' parameter is set to 'utf-8' the
+// encoding is set to UTF-8. A missing content type header is
+// interpreted as 'text/plain; charset=utf-8'.
+func (l *Loader) LoadURL(url string) (*Properties, error) {
+ resp, err := http.Get(url)
+ if err != nil {
+ return nil, fmt.Errorf("properties: error fetching %q. %s", url, err)
+ }
+
+ if resp.StatusCode == 404 && l.IgnoreMissing {
+ LogPrintf("properties: %s returned %d. skipping", url, resp.StatusCode)
+ return NewProperties(), nil
+ }
+
+ if resp.StatusCode != 200 {
+ return nil, fmt.Errorf("properties: %s returned %d", url, resp.StatusCode)
+ }
+
+ body, err := ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
+ }
+ defer resp.Body.Close()
+
+ ct := resp.Header.Get("Content-Type")
+ var enc Encoding
+ switch strings.ToLower(ct) {
+ case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1":
+ enc = ISO_8859_1
+ case "", "text/plain; charset=utf-8":
+ enc = UTF8
+ default:
+ return nil, fmt.Errorf("properties: invalid content type %s", ct)
+ }
+
+ return l.loadBytes(body, enc)
+}
+
+func (l *Loader) loadBytes(buf []byte, enc Encoding) (*Properties, error) {
+ p, err := parse(convert(buf, enc))
+ if err != nil {
+ return nil, err
+ }
+ p.DisableExpansion = l.DisableExpansion
+ if p.DisableExpansion {
+ return p, nil
+ }
+ return p, p.check()
+}
+
// Load reads a buffer into a Properties struct.
func Load(buf []byte, enc Encoding) (*Properties, error) {
- return loadBuf(buf, enc)
+ l := &Loader{Encoding: enc}
+ return l.LoadBytes(buf)
}
// LoadString reads an UTF8 string into a properties struct.
func LoadString(s string) (*Properties, error) {
- return loadBuf([]byte(s), UTF8)
+ l := &Loader{Encoding: UTF8}
+ return l.LoadBytes([]byte(s))
}
// LoadMap creates a new Properties struct from a string map.
@@ -44,34 +180,32 @@ func LoadMap(m map[string]string) *Properties {
// LoadFile reads a file into a Properties struct.
func LoadFile(filename string, enc Encoding) (*Properties, error) {
- return loadAll([]string{filename}, enc, false)
+ l := &Loader{Encoding: enc}
+ return l.LoadAll([]string{filename})
}
// LoadFiles reads multiple files in the given order into
// a Properties struct. If 'ignoreMissing' is true then
// non-existent files will not be reported as error.
func LoadFiles(filenames []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
- return loadAll(filenames, enc, ignoreMissing)
+ l := &Loader{Encoding: enc, IgnoreMissing: ignoreMissing}
+ return l.LoadAll(filenames)
}
// LoadURL reads the content of the URL into a Properties struct.
-//
-// The encoding is determined via the Content-Type header which
-// should be set to 'text/plain'. If the 'charset' parameter is
-// missing, 'iso-8859-1' or 'latin1' the encoding is set to
-// ISO-8859-1. If the 'charset' parameter is set to 'utf-8' the
-// encoding is set to UTF-8. A missing content type header is
-// interpreted as 'text/plain; charset=utf-8'.
+// See Loader#LoadURL for details.
func LoadURL(url string) (*Properties, error) {
- return loadAll([]string{url}, UTF8, false)
+ l := &Loader{Encoding: UTF8}
+ return l.LoadAll([]string{url})
}
// LoadURLs reads the content of multiple URLs in the given order into a
-// Properties struct. If 'ignoreMissing' is true then a 404 status code will
-// not be reported as error. See LoadURL for the Content-Type header
+// Properties struct. If IgnoreMissing is true then a 404 status code will
+// not be reported as error. See Loader#LoadURL for the Content-Type header
// and the encoding.
func LoadURLs(urls []string, ignoreMissing bool) (*Properties, error) {
- return loadAll(urls, UTF8, ignoreMissing)
+ l := &Loader{Encoding: UTF8, IgnoreMissing: ignoreMissing}
+ return l.LoadAll(urls)
}
// LoadAll reads the content of multiple URLs or files in the given order into a
@@ -79,7 +213,8 @@ func LoadURLs(urls []string, ignoreMissing bool) (*Properties, error) {
// not be reported as error. Encoding sets the encoding for files. For the URLs please see
// LoadURL for the Content-Type header and the encoding.
func LoadAll(names []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
- return loadAll(names, enc, ignoreMissing)
+ l := &Loader{Encoding: enc, IgnoreMissing: ignoreMissing}
+ return l.LoadAll(names)
}
// MustLoadString reads an UTF8 string into a Properties struct and
@@ -122,90 +257,6 @@ func MustLoadAll(names []string, enc Encoding, ignoreMissing bool) *Properties {
return must(LoadAll(names, enc, ignoreMissing))
}
-func loadBuf(buf []byte, enc Encoding) (*Properties, error) {
- p, err := parse(convert(buf, enc))
- if err != nil {
- return nil, err
- }
- return p, p.check()
-}
-
-func loadAll(names []string, enc Encoding, ignoreMissing bool) (*Properties, error) {
- result := NewProperties()
- for _, name := range names {
- n, err := expandName(name)
- if err != nil {
- return nil, err
- }
- var p *Properties
- if strings.HasPrefix(n, "http://") || strings.HasPrefix(n, "https://") {
- p, err = loadURL(n, ignoreMissing)
- } else {
- p, err = loadFile(n, enc, ignoreMissing)
- }
- if err != nil {
- return nil, err
- }
- result.Merge(p)
-
- }
- return result, result.check()
-}
-
-func loadFile(filename string, enc Encoding, ignoreMissing bool) (*Properties, error) {
- data, err := ioutil.ReadFile(filename)
- if err != nil {
- if ignoreMissing && os.IsNotExist(err) {
- LogPrintf("properties: %s not found. skipping", filename)
- return NewProperties(), nil
- }
- return nil, err
- }
- p, err := parse(convert(data, enc))
- if err != nil {
- return nil, err
- }
- return p, nil
-}
-
-func loadURL(url string, ignoreMissing bool) (*Properties, error) {
- resp, err := http.Get(url)
- if err != nil {
- return nil, fmt.Errorf("properties: error fetching %q. %s", url, err)
- }
- if resp.StatusCode == 404 && ignoreMissing {
- LogPrintf("properties: %s returned %d. skipping", url, resp.StatusCode)
- return NewProperties(), nil
- }
- if resp.StatusCode != 200 {
- return nil, fmt.Errorf("properties: %s returned %d", url, resp.StatusCode)
- }
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
- }
- if err = resp.Body.Close(); err != nil {
- return nil, fmt.Errorf("properties: %s error reading response. %s", url, err)
- }
-
- ct := resp.Header.Get("Content-Type")
- var enc Encoding
- switch strings.ToLower(ct) {
- case "text/plain", "text/plain; charset=iso-8859-1", "text/plain; charset=latin1":
- enc = ISO_8859_1
- case "", "text/plain; charset=utf-8":
- enc = UTF8
- default:
- return nil, fmt.Errorf("properties: invalid content type %s", ct)
- }
-
- p, err := parse(convert(body, enc))
- if err != nil {
- return nil, err
- }
- return p, nil
-}
-
func must(p *Properties, err error) *Properties {
if err != nil {
ErrorHandler(err)
@@ -226,7 +277,7 @@ func expandName(name string) (string, error) {
// first 256 unicode code points cover ISO-8859-1.
func convert(buf []byte, enc Encoding) string {
switch enc {
- case UTF8:
+ case utf8Default, UTF8:
return string(buf)
case ISO_8859_1:
runes := make([]rune, len(buf))
diff --git a/vendor/github.com/magiconair/properties/parser.go b/vendor/github.com/magiconair/properties/parser.go
index 90f555cb9..cdc4a8034 100644
--- a/vendor/github.com/magiconair/properties/parser.go
+++ b/vendor/github.com/magiconair/properties/parser.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/magiconair/properties/properties.go b/vendor/github.com/magiconair/properties/properties.go
index 53f5b2ff0..cb3d1a332 100644
--- a/vendor/github.com/magiconair/properties/properties.go
+++ b/vendor/github.com/magiconair/properties/properties.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -83,6 +83,17 @@ func NewProperties() *Properties {
}
}
+// Load reads a buffer into the given Properties struct.
+func (p *Properties) Load(buf []byte, enc Encoding) error {
+ l := &Loader{Encoding: enc, DisableExpansion: p.DisableExpansion}
+ newProperties, err := l.LoadBytes(buf)
+ if err != nil {
+ return err
+ }
+ p.Merge(newProperties)
+ return nil
+}
+
// Get returns the expanded value for the given key if exists.
// Otherwise, ok is false.
func (p *Properties) Get(key string) (value string, ok bool) {
diff --git a/vendor/github.com/magiconair/properties/rangecheck.go b/vendor/github.com/magiconair/properties/rangecheck.go
index 2e907d540..b013a2e5e 100644
--- a/vendor/github.com/magiconair/properties/rangecheck.go
+++ b/vendor/github.com/magiconair/properties/rangecheck.go
@@ -1,4 +1,4 @@
-// Copyright 2017 Frank Schroeder. All rights reserved.
+// Copyright 2018 Frank Schroeder. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
diff --git a/vendor/github.com/miekg/dns/client.go b/vendor/github.com/miekg/dns/client.go
index 282565afd..6aa4235d1 100644
--- a/vendor/github.com/miekg/dns/client.go
+++ b/vendor/github.com/miekg/dns/client.go
@@ -7,8 +7,12 @@ import (
"context"
"crypto/tls"
"encoding/binary"
+ "fmt"
"io"
+ "io/ioutil"
"net"
+ "net/http"
+ "net/url"
"strings"
"time"
)
@@ -16,6 +20,8 @@ import (
const dnsTimeout time.Duration = 2 * time.Second
const tcpIdleTimeout time.Duration = 8 * time.Second
+const dohMimeType = "application/dns-udpwireformat"
+
// A Conn represents a connection to a DNS server.
type Conn struct {
net.Conn // a net.Conn holding the connection
@@ -37,6 +43,7 @@ type Client struct {
DialTimeout time.Duration // net.DialTimeout, defaults to 2 seconds, or net.Dialer.Timeout if expiring earlier - overridden by Timeout when that value is non-zero
ReadTimeout time.Duration // net.Conn.SetReadTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero
WriteTimeout time.Duration // net.Conn.SetWriteTimeout value for connections, defaults to 2 seconds - overridden by Timeout when that value is non-zero
+ HTTPClient *http.Client // The http.Client to use for DNS-over-HTTPS
TsigSecret map[string]string // secret(s) for Tsig map[<zonename>]<base64 secret>, zonename must be in canonical form (lowercase, fqdn, see RFC 4034 Section 6.2)
SingleInflight bool // if true suppress multiple outstanding queries for the same Qname, Qtype and Qclass
group singleflight
@@ -134,6 +141,11 @@ func (c *Client) Dial(address string) (conn *Conn, err error) {
// attribute appropriately
func (c *Client) Exchange(m *Msg, address string) (r *Msg, rtt time.Duration, err error) {
if !c.SingleInflight {
+ if c.Net == "https" {
+ // TODO(tmthrgd): pipe timeouts into exchangeDOH
+ return c.exchangeDOH(context.TODO(), m, address)
+ }
+
return c.exchange(m, address)
}
@@ -146,6 +158,11 @@ func (c *Client) Exchange(m *Msg, address string) (r *Msg, rtt time.Duration, er
cl = cl1
}
r, rtt, err, shared := c.group.Do(m.Question[0].Name+t+cl, func() (*Msg, time.Duration, error) {
+ if c.Net == "https" {
+ // TODO(tmthrgd): pipe timeouts into exchangeDOH
+ return c.exchangeDOH(context.TODO(), m, address)
+ }
+
return c.exchange(m, address)
})
if r != nil && shared {
@@ -191,6 +208,77 @@ func (c *Client) exchange(m *Msg, a string) (r *Msg, rtt time.Duration, err erro
return r, rtt, err
}
+func (c *Client) exchangeDOH(ctx context.Context, m *Msg, a string) (r *Msg, rtt time.Duration, err error) {
+ p, err := m.Pack()
+ if err != nil {
+ return nil, 0, err
+ }
+
+ // TODO(tmthrgd): Allow the path to be customised?
+ u := &url.URL{
+ Scheme: "https",
+ Host: a,
+ Path: "/.well-known/dns-query",
+ }
+ if u.Port() == "443" {
+ u.Host = u.Hostname()
+ }
+
+ req, err := http.NewRequest(http.MethodPost, u.String(), bytes.NewReader(p))
+ if err != nil {
+ return nil, 0, err
+ }
+
+ req.Header.Set("Content-Type", dohMimeType)
+ req.Header.Set("Accept", dohMimeType)
+
+ t := time.Now()
+
+ hc := http.DefaultClient
+ if c.HTTPClient != nil {
+ hc = c.HTTPClient
+ }
+
+ if ctx != context.Background() && ctx != context.TODO() {
+ req = req.WithContext(ctx)
+ }
+
+ resp, err := hc.Do(req)
+ if err != nil {
+ return nil, 0, err
+ }
+ defer closeHTTPBody(resp.Body)
+
+ if resp.StatusCode != http.StatusOK {
+ return nil, 0, fmt.Errorf("dns: server returned HTTP %d error: %q", resp.StatusCode, resp.Status)
+ }
+
+ if ct := resp.Header.Get("Content-Type"); ct != dohMimeType {
+ return nil, 0, fmt.Errorf("dns: unexpected Content-Type %q; expected %q", ct, dohMimeType)
+ }
+
+ p, err = ioutil.ReadAll(resp.Body)
+ if err != nil {
+ return nil, 0, err
+ }
+
+ rtt = time.Since(t)
+
+ r = new(Msg)
+ if err := r.Unpack(p); err != nil {
+ return r, 0, err
+ }
+
+ // TODO: TSIG? Is it even supported over DoH?
+
+ return r, rtt, nil
+}
+
+func closeHTTPBody(r io.ReadCloser) error {
+ io.Copy(ioutil.Discard, io.LimitReader(r, 8<<20))
+ return r.Close()
+}
+
// ReadMsg reads a message from the connection co.
// If the received message contains a TSIG record the transaction signature
// is verified. This method always tries to return the message, however if an
@@ -490,6 +578,10 @@ func DialTimeoutWithTLS(network, address string, tlsConfig *tls.Config, timeout
// context, if present. If there is both a context deadline and a configured
// timeout on the client, the earliest of the two takes effect.
func (c *Client) ExchangeContext(ctx context.Context, m *Msg, a string) (r *Msg, rtt time.Duration, err error) {
+ if !c.SingleInflight && c.Net == "https" {
+ return c.exchangeDOH(ctx, m, a)
+ }
+
var timeout time.Duration
if deadline, ok := ctx.Deadline(); !ok {
timeout = 0
@@ -498,6 +590,7 @@ func (c *Client) ExchangeContext(ctx context.Context, m *Msg, a string) (r *Msg,
}
// not passing the context to the underlying calls, as the API does not support
// context. For timeouts you should set up Client.Dialer and call Client.Exchange.
+ // TODO(tmthrgd): this is a race condition
c.Dialer = &net.Dialer{Timeout: timeout}
return c.Exchange(m, a)
}
diff --git a/vendor/github.com/miekg/dns/compress_generate.go b/vendor/github.com/miekg/dns/compress_generate.go
index 87fb36f68..9a136c414 100644
--- a/vendor/github.com/miekg/dns/compress_generate.go
+++ b/vendor/github.com/miekg/dns/compress_generate.go
@@ -101,7 +101,8 @@ Names:
// compressionLenHelperType - all types that have domain-name/cdomain-name can be used for compressing names
- fmt.Fprint(b, "func compressionLenHelperType(c map[string]int, r RR) {\n")
+ fmt.Fprint(b, "func compressionLenHelperType(c map[string]int, r RR, initLen int) int {\n")
+ fmt.Fprint(b, "currentLen := initLen\n")
fmt.Fprint(b, "switch x := r.(type) {\n")
for _, name := range domainTypes {
o := scope.Lookup(name)
@@ -109,7 +110,10 @@ Names:
fmt.Fprintf(b, "case *%s:\n", name)
for i := 1; i < st.NumFields(); i++ {
- out := func(s string) { fmt.Fprintf(b, "compressionLenHelper(c, x.%s)\n", st.Field(i).Name()) }
+ out := func(s string) {
+ fmt.Fprintf(b, "currentLen -= len(x.%s) + 1\n", st.Field(i).Name())
+ fmt.Fprintf(b, "currentLen += compressionLenHelper(c, x.%s, currentLen)\n", st.Field(i).Name())
+ }
if _, ok := st.Field(i).Type().(*types.Slice); ok {
switch st.Tag(i) {
@@ -118,8 +122,12 @@ Names:
case `dns:"cdomain-name"`:
// For HIP we need to slice over the elements in this slice.
fmt.Fprintf(b, `for i := range x.%s {
- compressionLenHelper(c, x.%s[i])
- }
+ currentLen -= len(x.%s[i]) + 1
+}
+`, st.Field(i).Name(), st.Field(i).Name())
+ fmt.Fprintf(b, `for i := range x.%s {
+ currentLen += compressionLenHelper(c, x.%s[i], currentLen)
+}
`, st.Field(i).Name(), st.Field(i).Name())
}
continue
@@ -133,11 +141,11 @@ Names:
}
}
}
- fmt.Fprintln(b, "}\n}\n\n")
+ fmt.Fprintln(b, "}\nreturn currentLen - initLen\n}\n\n")
// compressionLenSearchType - search cdomain-tags types for compressible names.
- fmt.Fprint(b, "func compressionLenSearchType(c map[string]int, r RR) (int, bool) {\n")
+ fmt.Fprint(b, "func compressionLenSearchType(c map[string]int, r RR) (int, bool, int) {\n")
fmt.Fprint(b, "switch x := r.(type) {\n")
for _, name := range cdomainTypes {
o := scope.Lookup(name)
@@ -147,7 +155,7 @@ Names:
j := 1
for i := 1; i < st.NumFields(); i++ {
out := func(s string, j int) {
- fmt.Fprintf(b, "k%d, ok%d := compressionLenSearch(c, x.%s)\n", j, j, st.Field(i).Name())
+ fmt.Fprintf(b, "k%d, ok%d, sz%d := compressionLenSearch(c, x.%s)\n", j, j, j, st.Field(i).Name())
}
// There are no slice types with names that can be compressed.
@@ -160,13 +168,15 @@ Names:
}
k := "k1"
ok := "ok1"
+ sz := "sz1"
for i := 2; i < j; i++ {
k += fmt.Sprintf(" + k%d", i)
ok += fmt.Sprintf(" && ok%d", i)
+ sz += fmt.Sprintf(" + sz%d", i)
}
- fmt.Fprintf(b, "return %s, %s\n", k, ok)
+ fmt.Fprintf(b, "return %s, %s, %s\n", k, ok, sz)
}
- fmt.Fprintln(b, "}\nreturn 0, false\n}\n\n")
+ fmt.Fprintln(b, "}\nreturn 0, false, 0\n}\n\n")
// gofmt
res, err := format.Source(b.Bytes())
diff --git a/vendor/github.com/miekg/dns/dns.go b/vendor/github.com/miekg/dns/dns.go
index 5133eac72..e7557f51a 100644
--- a/vendor/github.com/miekg/dns/dns.go
+++ b/vendor/github.com/miekg/dns/dns.go
@@ -55,16 +55,6 @@ func (h *RR_Header) Header() *RR_Header { return h }
// Just to implement the RR interface.
func (h *RR_Header) copy() RR { return nil }
-func (h *RR_Header) copyHeader() *RR_Header {
- r := new(RR_Header)
- r.Name = h.Name
- r.Rrtype = h.Rrtype
- r.Class = h.Class
- r.Ttl = h.Ttl
- r.Rdlength = h.Rdlength
- return r
-}
-
func (h *RR_Header) String() string {
var s string
diff --git a/vendor/github.com/miekg/dns/dnssec.go b/vendor/github.com/miekg/dns/dnssec.go
index ac9fdd45e..478cb1e90 100644
--- a/vendor/github.com/miekg/dns/dnssec.go
+++ b/vendor/github.com/miekg/dns/dnssec.go
@@ -73,6 +73,7 @@ var StringToAlgorithm = reverseInt8(AlgorithmToString)
// AlgorithmToHash is a map of algorithm crypto hash IDs to crypto.Hash's.
var AlgorithmToHash = map[uint8]crypto.Hash{
RSAMD5: crypto.MD5, // Deprecated in RFC 6725
+ DSA: crypto.SHA1,
RSASHA1: crypto.SHA1,
RSASHA1NSEC3SHA1: crypto.SHA1,
RSASHA256: crypto.SHA256,
@@ -239,7 +240,7 @@ func (k *DNSKEY) ToDS(h uint8) *DS {
// ToCDNSKEY converts a DNSKEY record to a CDNSKEY record.
func (k *DNSKEY) ToCDNSKEY() *CDNSKEY {
c := &CDNSKEY{DNSKEY: *k}
- c.Hdr = *k.Hdr.copyHeader()
+ c.Hdr = k.Hdr
c.Hdr.Rrtype = TypeCDNSKEY
return c
}
@@ -247,7 +248,7 @@ func (k *DNSKEY) ToCDNSKEY() *CDNSKEY {
// ToCDS converts a DS record to a CDS record.
func (d *DS) ToCDS() *CDS {
c := &CDS{DS: *d}
- c.Hdr = *d.Hdr.copyHeader()
+ c.Hdr = d.Hdr
c.Hdr.Rrtype = TypeCDS
return c
}
diff --git a/vendor/github.com/miekg/dns/doc.go b/vendor/github.com/miekg/dns/doc.go
index 1d8114744..0389d7248 100644
--- a/vendor/github.com/miekg/dns/doc.go
+++ b/vendor/github.com/miekg/dns/doc.go
@@ -73,11 +73,11 @@ and port to use for the connection:
Port: 12345,
Zone: "",
}
- d := net.Dialer{
+ c.Dialer := &net.Dialer{
Timeout: 200 * time.Millisecond,
LocalAddr: &laddr,
}
- in, rtt, err := c.ExchangeWithDialer(&d, m1, "8.8.8.8:53")
+ in, rtt, err := c.Exchange(m1, "8.8.8.8:53")
If these "advanced" features are not needed, a simple UDP query can be sent,
with:
diff --git a/vendor/github.com/miekg/dns/msg.go b/vendor/github.com/miekg/dns/msg.go
index 276e6b027..dcd3b6a5e 100644
--- a/vendor/github.com/miekg/dns/msg.go
+++ b/vendor/github.com/miekg/dns/msg.go
@@ -691,18 +691,20 @@ func (dns *Msg) Pack() (msg []byte, err error) {
return dns.PackBuffer(nil)
}
-// PackBuffer packs a Msg, using the given buffer buf. If buf is too small
-// a new buffer is allocated.
+// PackBuffer packs a Msg, using the given buffer buf. If buf is too small a new buffer is allocated.
func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) {
- // We use a similar function in tsig.go's stripTsig.
- var (
- dh Header
- compression map[string]int
- )
-
+ var compression map[string]int
if dns.Compress {
- compression = make(map[string]int) // Compression pointer mappings
+ compression = make(map[string]int) // Compression pointer mappings.
}
+ return dns.packBufferWithCompressionMap(buf, compression)
+}
+
+// packBufferWithCompressionMap packs a Msg, using the given buffer buf.
+func (dns *Msg) packBufferWithCompressionMap(buf []byte, compression map[string]int) (msg []byte, err error) {
+ // We use a similar function in tsig.go's stripTsig.
+
+ var dh Header
if dns.Rcode < 0 || dns.Rcode > 0xFFF {
return nil, ErrRcode
@@ -714,12 +716,11 @@ func (dns *Msg) PackBuffer(buf []byte) (msg []byte, err error) {
return nil, ErrExtendedRcode
}
opt.SetExtendedRcode(uint8(dns.Rcode >> 4))
- dns.Rcode &= 0xF
}
// Convert convenient Msg into wire-like Header.
dh.Id = dns.Id
- dh.Bits = uint16(dns.Opcode)<<11 | uint16(dns.Rcode)
+ dh.Bits = uint16(dns.Opcode)<<11 | uint16(dns.Rcode&0xF)
if dns.Response {
dh.Bits |= _QR
}
@@ -922,23 +923,27 @@ func (dns *Msg) String() string {
// than packing it, measuring the size and discarding the buffer.
func (dns *Msg) Len() int { return compressedLen(dns, dns.Compress) }
+func compressedLenWithCompressionMap(dns *Msg, compression map[string]int) int {
+ l := 12 // Message header is always 12 bytes
+ for _, r := range dns.Question {
+ compressionLenHelper(compression, r.Name, l)
+ l += r.len()
+ }
+ l += compressionLenSlice(l, compression, dns.Answer)
+ l += compressionLenSlice(l, compression, dns.Ns)
+ l += compressionLenSlice(l, compression, dns.Extra)
+ return l
+}
+
// compressedLen returns the message length when in compressed wire format
// when compress is true, otherwise the uncompressed length is returned.
func compressedLen(dns *Msg, compress bool) int {
// We always return one more than needed.
- l := 12 // Message header is always 12 bytes
if compress {
compression := map[string]int{}
- for _, r := range dns.Question {
- l += r.len()
- compressionLenHelper(compression, r.Name)
- }
- l += compressionLenSlice(l, compression, dns.Answer)
- l += compressionLenSlice(l, compression, dns.Ns)
- l += compressionLenSlice(l, compression, dns.Extra)
-
- return l
+ return compressedLenWithCompressionMap(dns, compression)
}
+ l := 12 // Message header is always 12 bytes
for _, r := range dns.Question {
l += r.len()
@@ -962,70 +967,94 @@ func compressedLen(dns *Msg, compress bool) int {
return l
}
-func compressionLenSlice(len int, c map[string]int, rs []RR) int {
- var l int
+func compressionLenSlice(lenp int, c map[string]int, rs []RR) int {
+ initLen := lenp
for _, r := range rs {
if r == nil {
continue
}
- // track this length, and the global length in len, while taking compression into account for both.
- x := r.len()
- l += x
- len += x
+ // TmpLen is to track len of record at 14bits boudaries
+ tmpLen := lenp
- k, ok := compressionLenSearch(c, r.Header().Name)
+ x := r.len()
+ // track this length, and the global length in len, while taking compression into account for both.
+ k, ok, _ := compressionLenSearch(c, r.Header().Name)
if ok {
- l += 1 - k
- len += 1 - k
- }
-
- if len < maxCompressionOffset {
- compressionLenHelper(c, r.Header().Name)
+ // Size of x is reduced by k, but we add 1 since k includes the '.' and label descriptor take 2 bytes
+ // so, basically x:= x - k - 1 + 2
+ x += 1 - k
}
- k, ok = compressionLenSearchType(c, r)
+ tmpLen += compressionLenHelper(c, r.Header().Name, tmpLen)
+ k, ok, _ = compressionLenSearchType(c, r)
if ok {
- l += 1 - k
- len += 1 - k
+ x += 1 - k
}
+ lenp += x
+ tmpLen = lenp
+ tmpLen += compressionLenHelperType(c, r, tmpLen)
- if len < maxCompressionOffset {
- compressionLenHelperType(c, r)
- }
}
- return l
+ return lenp - initLen
}
-// Put the parts of the name in the compression map.
-func compressionLenHelper(c map[string]int, s string) {
+// Put the parts of the name in the compression map, return the size in bytes added in payload
+func compressionLenHelper(c map[string]int, s string, currentLen int) int {
+ if currentLen > maxCompressionOffset {
+ // We won't be able to add any label that could be re-used later anyway
+ return 0
+ }
+ if _, ok := c[s]; ok {
+ return 0
+ }
+ initLen := currentLen
pref := ""
+ prev := s
lbs := Split(s)
- for j := len(lbs) - 1; j >= 0; j-- {
+ for j := 0; j < len(lbs); j++ {
pref = s[lbs[j]:]
+ currentLen += len(prev) - len(pref)
+ prev = pref
if _, ok := c[pref]; !ok {
- c[pref] = len(pref)
+ // If first byte label is within the first 14bits, it might be re-used later
+ if currentLen < maxCompressionOffset {
+ c[pref] = currentLen
+ }
+ } else {
+ added := currentLen - initLen
+ if j > 0 {
+ // We added a new PTR
+ added += 2
+ }
+ return added
}
}
+ return currentLen - initLen
}
// Look for each part in the compression map and returns its length,
// keep on searching so we get the longest match.
-func compressionLenSearch(c map[string]int, s string) (int, bool) {
+// Will return the size of compression found, whether a match has been
+// found and the size of record if added in payload
+func compressionLenSearch(c map[string]int, s string) (int, bool, int) {
off := 0
end := false
if s == "" { // don't bork on bogus data
- return 0, false
+ return 0, false, 0
}
+ fullSize := 0
for {
if _, ok := c[s[off:]]; ok {
- return len(s[off:]), true
+ return len(s[off:]), true, fullSize + off
}
if end {
break
}
+ // Each label descriptor takes 2 bytes, add it
+ fullSize += 2
off, end = NextLabel(s, off)
}
- return 0, false
+ return 0, false, fullSize + len(s)
}
// Copy returns a new RR which is a deep-copy of r.
diff --git a/vendor/github.com/miekg/dns/privaterr.go b/vendor/github.com/miekg/dns/privaterr.go
index 6b08e6e95..41989e7ae 100644
--- a/vendor/github.com/miekg/dns/privaterr.go
+++ b/vendor/github.com/miekg/dns/privaterr.go
@@ -56,8 +56,7 @@ func (r *PrivateRR) len() int { return r.Hdr.len() + r.Data.Len() }
func (r *PrivateRR) copy() RR {
// make new RR like this:
rr := mkPrivateRR(r.Hdr.Rrtype)
- newh := r.Hdr.copyHeader()
- rr.Hdr = *newh
+ rr.Hdr = r.Hdr
err := r.Data.Copy(rr.Data)
if err != nil {
diff --git a/vendor/github.com/miekg/dns/scan_rr.go b/vendor/github.com/miekg/dns/scan_rr.go
index f4ccc8424..fb6f95d1d 100644
--- a/vendor/github.com/miekg/dns/scan_rr.go
+++ b/vendor/github.com/miekg/dns/scan_rr.go
@@ -1255,8 +1255,10 @@ func setNSEC3(h RR_Header, c chan lex, o, f string) (RR, *ParseError, string) {
if len(l.token) == 0 || l.err {
return nil, &ParseError{f, "bad NSEC3 Salt", l}, ""
}
- rr.SaltLength = uint8(len(l.token)) / 2
- rr.Salt = l.token
+ if l.token != "-" {
+ rr.SaltLength = uint8(len(l.token)) / 2
+ rr.Salt = l.token
+ }
<-c
l = <-c
@@ -1321,8 +1323,10 @@ func setNSEC3PARAM(h RR_Header, c chan lex, o, f string) (RR, *ParseError, strin
rr.Iterations = uint16(i)
<-c
l = <-c
- rr.SaltLength = uint8(len(l.token))
- rr.Salt = l.token
+ if l.token != "-" {
+ rr.SaltLength = uint8(len(l.token))
+ rr.Salt = l.token
+ }
return rr, nil, ""
}
diff --git a/vendor/github.com/miekg/dns/server.go b/vendor/github.com/miekg/dns/server.go
index 685753f43..2d98f1488 100644
--- a/vendor/github.com/miekg/dns/server.go
+++ b/vendor/github.com/miekg/dns/server.go
@@ -9,12 +9,19 @@ import (
"io"
"net"
"sync"
+ "sync/atomic"
"time"
)
-// Maximum number of TCP queries before we close the socket.
+// Default maximum number of TCP queries before we close the socket.
const maxTCPQueries = 128
+// Interval for stop worker if no load
+const idleWorkerTimeout = 10 * time.Second
+
+// Maximum number of workers
+const maxWorkersCount = 10000
+
// Handler is implemented by any value that implements ServeDNS.
type Handler interface {
ServeDNS(w ResponseWriter, r *Msg)
@@ -43,6 +50,7 @@ type ResponseWriter interface {
}
type response struct {
+ msg []byte
hijacked bool // connection has been hijacked by handler
tsigStatus error
tsigTimersOnly bool
@@ -51,7 +59,6 @@ type response struct {
udp *net.UDPConn // i/o connection if UDP was used
tcp net.Conn // i/o connection if TCP was used
udpSession *SessionUDP // oob data to get egress interface right
- remoteAddr net.Addr // address of the client
writer Writer // writer to output the raw DNS bits
}
@@ -296,12 +303,63 @@ type Server struct {
DecorateReader DecorateReader
// DecorateWriter is optional, allows customization of the process that writes raw DNS messages.
DecorateWriter DecorateWriter
+ // Maximum number of TCP queries before we close the socket. Default is maxTCPQueries (unlimited if -1).
+ MaxTCPQueries int
+ // UDP packet or TCP connection queue
+ queue chan *response
+ // Workers count
+ workersCount int32
// Shutdown handling
lock sync.RWMutex
started bool
}
+func (srv *Server) worker(w *response) {
+ srv.serve(w)
+
+ for {
+ count := atomic.LoadInt32(&srv.workersCount)
+ if count > maxWorkersCount {
+ return
+ }
+ if atomic.CompareAndSwapInt32(&srv.workersCount, count, count+1) {
+ break
+ }
+ }
+
+ defer atomic.AddInt32(&srv.workersCount, -1)
+
+ inUse := false
+ timeout := time.NewTimer(idleWorkerTimeout)
+ defer timeout.Stop()
+LOOP:
+ for {
+ select {
+ case w, ok := <-srv.queue:
+ if !ok {
+ break LOOP
+ }
+ inUse = true
+ srv.serve(w)
+ case <-timeout.C:
+ if !inUse {
+ break LOOP
+ }
+ inUse = false
+ timeout.Reset(idleWorkerTimeout)
+ }
+ }
+}
+
+func (srv *Server) spawnWorker(w *response) {
+ select {
+ case srv.queue <- w:
+ default:
+ go srv.worker(w)
+ }
+}
+
// ListenAndServe starts a nameserver on the configured address in *Server.
func (srv *Server) ListenAndServe() error {
srv.lock.Lock()
@@ -309,6 +367,7 @@ func (srv *Server) ListenAndServe() error {
if srv.started {
return &Error{err: "server already started"}
}
+
addr := srv.Addr
if addr == "" {
addr = ":domain"
@@ -316,6 +375,8 @@ func (srv *Server) ListenAndServe() error {
if srv.UDPSize == 0 {
srv.UDPSize = MinMsgSize
}
+ srv.queue = make(chan *response)
+ defer close(srv.queue)
switch srv.Net {
case "tcp", "tcp4", "tcp6":
a, err := net.ResolveTCPAddr(srv.Net, addr)
@@ -380,8 +441,11 @@ func (srv *Server) ActivateAndServe() error {
if srv.started {
return &Error{err: "server already started"}
}
+
pConn := srv.PacketConn
l := srv.Listener
+ srv.queue = make(chan *response)
+ defer close(srv.queue)
if pConn != nil {
if srv.UDPSize == 0 {
srv.UDPSize = MinMsgSize
@@ -439,7 +503,6 @@ func (srv *Server) getReadTimeout() time.Duration {
}
// serveTCP starts a TCP listener for the server.
-// Each request is handled in a separate goroutine.
func (srv *Server) serveTCP(l net.Listener) error {
defer l.Close()
@@ -447,17 +510,6 @@ func (srv *Server) serveTCP(l net.Listener) error {
srv.NotifyStartedFunc()
}
- reader := Reader(&defaultReader{srv})
- if srv.DecorateReader != nil {
- reader = srv.DecorateReader(reader)
- }
-
- handler := srv.Handler
- if handler == nil {
- handler = DefaultServeMux
- }
- rtimeout := srv.getReadTimeout()
- // deadline is not used here
for {
rw, err := l.Accept()
srv.lock.RLock()
@@ -472,19 +524,11 @@ func (srv *Server) serveTCP(l net.Listener) error {
}
return err
}
- go func() {
- m, err := reader.ReadTCP(rw, rtimeout)
- if err != nil {
- rw.Close()
- return
- }
- srv.serve(rw.RemoteAddr(), handler, m, nil, nil, rw)
- }()
+ srv.spawnWorker(&response{tsigSecret: srv.TsigSecret, tcp: rw})
}
}
// serveUDP starts a UDP listener for the server.
-// Each request is handled in a separate goroutine.
func (srv *Server) serveUDP(l *net.UDPConn) error {
defer l.Close()
@@ -497,10 +541,6 @@ func (srv *Server) serveUDP(l *net.UDPConn) error {
reader = srv.DecorateReader(reader)
}
- handler := srv.Handler
- if handler == nil {
- handler = DefaultServeMux
- }
rtimeout := srv.getReadTimeout()
// deadline is not used here
for {
@@ -520,80 +560,98 @@ func (srv *Server) serveUDP(l *net.UDPConn) error {
if len(m) < headerSize {
continue
}
- go srv.serve(s.RemoteAddr(), handler, m, l, s, nil)
+ srv.spawnWorker(&response{msg: m, tsigSecret: srv.TsigSecret, udp: l, udpSession: s})
}
}
-// Serve a new connection.
-func (srv *Server) serve(a net.Addr, h Handler, m []byte, u *net.UDPConn, s *SessionUDP, t net.Conn) {
- w := &response{tsigSecret: srv.TsigSecret, udp: u, tcp: t, remoteAddr: a, udpSession: s}
+func (srv *Server) serve(w *response) {
if srv.DecorateWriter != nil {
w.writer = srv.DecorateWriter(w)
} else {
w.writer = w
}
- q := 0 // counter for the amount of TCP queries we get
+ if w.udp != nil {
+ // serve UDP
+ srv.serveDNS(w)
+ return
+ }
reader := Reader(&defaultReader{srv})
if srv.DecorateReader != nil {
reader = srv.DecorateReader(reader)
}
-Redo:
+
+ defer func() {
+ if !w.hijacked {
+ w.Close()
+ }
+ }()
+
+ idleTimeout := tcpIdleTimeout
+ if srv.IdleTimeout != nil {
+ idleTimeout = srv.IdleTimeout()
+ }
+
+ timeout := srv.getReadTimeout()
+
+ limit := srv.MaxTCPQueries
+ if limit == 0 {
+ limit = maxTCPQueries
+ }
+
+ for q := 0; q < limit || limit == -1; q++ {
+ var err error
+ w.msg, err = reader.ReadTCP(w.tcp, timeout)
+ if err != nil {
+ // TODO(tmthrgd): handle error
+ break
+ }
+ srv.serveDNS(w)
+ if w.tcp == nil {
+ break // Close() was called
+ }
+ if w.hijacked {
+ break // client will call Close() themselves
+ }
+ // The first read uses the read timeout, the rest use the
+ // idle timeout.
+ timeout = idleTimeout
+ }
+}
+
+func (srv *Server) serveDNS(w *response) {
req := new(Msg)
- err := req.Unpack(m)
+ err := req.Unpack(w.msg)
if err != nil { // Send a FormatError back
x := new(Msg)
x.SetRcodeFormatError(req)
w.WriteMsg(x)
- goto Exit
+ return
}
if !srv.Unsafe && req.Response {
- goto Exit
+ return
}
w.tsigStatus = nil
if w.tsigSecret != nil {
if t := req.IsTsig(); t != nil {
- secret := t.Hdr.Name
- if _, ok := w.tsigSecret[secret]; !ok {
- w.tsigStatus = ErrKeyAlg
+ if secret, ok := w.tsigSecret[t.Hdr.Name]; ok {
+ w.tsigStatus = TsigVerify(w.msg, secret, "", false)
+ } else {
+ w.tsigStatus = ErrSecret
}
- w.tsigStatus = TsigVerify(m, w.tsigSecret[secret], "", false)
w.tsigTimersOnly = false
w.tsigRequestMAC = req.Extra[len(req.Extra)-1].(*TSIG).MAC
}
}
- h.ServeDNS(w, req) // Writes back to the client
-Exit:
- if w.tcp == nil {
- return
- }
- // TODO(miek): make this number configurable?
- if q > maxTCPQueries { // close socket after this many queries
- w.Close()
- return
+ handler := srv.Handler
+ if handler == nil {
+ handler = DefaultServeMux
}
- if w.hijacked {
- return // client calls Close()
- }
- if u != nil { // UDP, "close" and return
- w.Close()
- return
- }
- idleTimeout := tcpIdleTimeout
- if srv.IdleTimeout != nil {
- idleTimeout = srv.IdleTimeout()
- }
- m, err = reader.ReadTCP(w.tcp, idleTimeout)
- if err == nil {
- q++
- goto Redo
- }
- w.Close()
- return
+ handler.ServeDNS(w, req) // Writes back to the client
}
func (srv *Server) readTCP(conn net.Conn, timeout time.Duration) ([]byte, error) {
@@ -696,7 +754,12 @@ func (w *response) LocalAddr() net.Addr {
}
// RemoteAddr implements the ResponseWriter.RemoteAddr method.
-func (w *response) RemoteAddr() net.Addr { return w.remoteAddr }
+func (w *response) RemoteAddr() net.Addr {
+ if w.tcp != nil {
+ return w.tcp.RemoteAddr()
+ }
+ return w.udpSession.RemoteAddr()
+}
// TsigStatus implements the ResponseWriter.TsigStatus method.
func (w *response) TsigStatus() error { return w.tsigStatus }
diff --git a/vendor/github.com/miekg/dns/types_generate.go b/vendor/github.com/miekg/dns/types_generate.go
index 8703cce64..b8db4f361 100644
--- a/vendor/github.com/miekg/dns/types_generate.go
+++ b/vendor/github.com/miekg/dns/types_generate.go
@@ -226,7 +226,7 @@ func main() {
continue
}
fmt.Fprintf(b, "func (rr *%s) copy() RR {\n", name)
- fields := []string{"*rr.Hdr.copyHeader()"}
+ fields := []string{"rr.Hdr"}
for i := 1; i < st.NumFields(); i++ {
f := st.Field(i).Name()
if sl, ok := st.Field(i).Type().(*types.Slice); ok {
diff --git a/vendor/github.com/miekg/dns/udp.go b/vendor/github.com/miekg/dns/udp.go
index f3f31a7ac..a4826ee2f 100644
--- a/vendor/github.com/miekg/dns/udp.go
+++ b/vendor/github.com/miekg/dns/udp.go
@@ -9,6 +9,22 @@ import (
"golang.org/x/net/ipv6"
)
+// This is the required size of the OOB buffer to pass to ReadMsgUDP.
+var udpOOBSize = func() int {
+ // We can't know whether we'll get an IPv4 control message or an
+ // IPv6 control message ahead of time. To get around this, we size
+ // the buffer equal to the largest of the two.
+
+ oob4 := ipv4.NewControlMessage(ipv4.FlagDst | ipv4.FlagInterface)
+ oob6 := ipv6.NewControlMessage(ipv6.FlagDst | ipv6.FlagInterface)
+
+ if len(oob4) > len(oob6) {
+ return len(oob4)
+ }
+
+ return len(oob6)
+}()
+
// SessionUDP holds the remote address and the associated
// out-of-band data.
type SessionUDP struct {
@@ -22,7 +38,7 @@ func (s *SessionUDP) RemoteAddr() net.Addr { return s.raddr }
// ReadFromSessionUDP acts just like net.UDPConn.ReadFrom(), but returns a session object instead of a
// net.UDPAddr.
func ReadFromSessionUDP(conn *net.UDPConn, b []byte) (int, *SessionUDP, error) {
- oob := make([]byte, 40)
+ oob := make([]byte, udpOOBSize)
n, oobn, _, raddr, err := conn.ReadMsgUDP(b, oob)
if err != nil {
return n, nil, err
@@ -53,18 +69,15 @@ func parseDstFromOOB(oob []byte) net.IP {
// Start with IPv6 and then fallback to IPv4
// TODO(fastest963): Figure out a way to prefer one or the other. Looking at
// the lvl of the header for a 0 or 41 isn't cross-platform.
- var dst net.IP
cm6 := new(ipv6.ControlMessage)
- if cm6.Parse(oob) == nil {
- dst = cm6.Dst
+ if cm6.Parse(oob) == nil && cm6.Dst != nil {
+ return cm6.Dst
}
- if dst == nil {
- cm4 := new(ipv4.ControlMessage)
- if cm4.Parse(oob) == nil {
- dst = cm4.Dst
- }
+ cm4 := new(ipv4.ControlMessage)
+ if cm4.Parse(oob) == nil && cm4.Dst != nil {
+ return cm4.Dst
}
- return dst
+ return nil
}
// correctSource takes oob data and returns new oob data with the Src equal to the Dst
diff --git a/vendor/github.com/miekg/dns/version.go b/vendor/github.com/miekg/dns/version.go
index e746fee5b..4f173d9d2 100644
--- a/vendor/github.com/miekg/dns/version.go
+++ b/vendor/github.com/miekg/dns/version.go
@@ -3,7 +3,7 @@ package dns
import "fmt"
// Version is current version of this library.
-var Version = V{1, 0, 5}
+var Version = V{1, 0, 7}
// V holds the version of this library.
type V struct {
diff --git a/vendor/github.com/miekg/dns/zcompress.go b/vendor/github.com/miekg/dns/zcompress.go
index c2503204d..a2c09dd48 100644
--- a/vendor/github.com/miekg/dns/zcompress.go
+++ b/vendor/github.com/miekg/dns/zcompress.go
@@ -2,117 +2,154 @@
package dns
-func compressionLenHelperType(c map[string]int, r RR) {
+func compressionLenHelperType(c map[string]int, r RR, initLen int) int {
+ currentLen := initLen
switch x := r.(type) {
case *AFSDB:
- compressionLenHelper(c, x.Hostname)
+ currentLen -= len(x.Hostname) + 1
+ currentLen += compressionLenHelper(c, x.Hostname, currentLen)
case *CNAME:
- compressionLenHelper(c, x.Target)
+ currentLen -= len(x.Target) + 1
+ currentLen += compressionLenHelper(c, x.Target, currentLen)
case *DNAME:
- compressionLenHelper(c, x.Target)
+ currentLen -= len(x.Target) + 1
+ currentLen += compressionLenHelper(c, x.Target, currentLen)
case *HIP:
for i := range x.RendezvousServers {
- compressionLenHelper(c, x.RendezvousServers[i])
+ currentLen -= len(x.RendezvousServers[i]) + 1
+ }
+ for i := range x.RendezvousServers {
+ currentLen += compressionLenHelper(c, x.RendezvousServers[i], currentLen)
}
case *KX:
- compressionLenHelper(c, x.Exchanger)
+ currentLen -= len(x.Exchanger) + 1
+ currentLen += compressionLenHelper(c, x.Exchanger, currentLen)
case *LP:
- compressionLenHelper(c, x.Fqdn)
+ currentLen -= len(x.Fqdn) + 1
+ currentLen += compressionLenHelper(c, x.Fqdn, currentLen)
case *MB:
- compressionLenHelper(c, x.Mb)
+ currentLen -= len(x.Mb) + 1
+ currentLen += compressionLenHelper(c, x.Mb, currentLen)
case *MD:
- compressionLenHelper(c, x.Md)
+ currentLen -= len(x.Md) + 1
+ currentLen += compressionLenHelper(c, x.Md, currentLen)
case *MF:
- compressionLenHelper(c, x.Mf)
+ currentLen -= len(x.Mf) + 1
+ currentLen += compressionLenHelper(c, x.Mf, currentLen)
case *MG:
- compressionLenHelper(c, x.Mg)
+ currentLen -= len(x.Mg) + 1
+ currentLen += compressionLenHelper(c, x.Mg, currentLen)
case *MINFO:
- compressionLenHelper(c, x.Rmail)
- compressionLenHelper(c, x.Email)
+ currentLen -= len(x.Rmail) + 1
+ currentLen += compressionLenHelper(c, x.Rmail, currentLen)
+ currentLen -= len(x.Email) + 1
+ currentLen += compressionLenHelper(c, x.Email, currentLen)
case *MR:
- compressionLenHelper(c, x.Mr)
+ currentLen -= len(x.Mr) + 1
+ currentLen += compressionLenHelper(c, x.Mr, currentLen)
case *MX:
- compressionLenHelper(c, x.Mx)
+ currentLen -= len(x.Mx) + 1
+ currentLen += compressionLenHelper(c, x.Mx, currentLen)
case *NAPTR:
- compressionLenHelper(c, x.Replacement)
+ currentLen -= len(x.Replacement) + 1
+ currentLen += compressionLenHelper(c, x.Replacement, currentLen)
case *NS:
- compressionLenHelper(c, x.Ns)
+ currentLen -= len(x.Ns) + 1
+ currentLen += compressionLenHelper(c, x.Ns, currentLen)
case *NSAPPTR:
- compressionLenHelper(c, x.Ptr)
+ currentLen -= len(x.Ptr) + 1
+ currentLen += compressionLenHelper(c, x.Ptr, currentLen)
case *NSEC:
- compressionLenHelper(c, x.NextDomain)
+ currentLen -= len(x.NextDomain) + 1
+ currentLen += compressionLenHelper(c, x.NextDomain, currentLen)
case *PTR:
- compressionLenHelper(c, x.Ptr)
+ currentLen -= len(x.Ptr) + 1
+ currentLen += compressionLenHelper(c, x.Ptr, currentLen)
case *PX:
- compressionLenHelper(c, x.Map822)
- compressionLenHelper(c, x.Mapx400)
+ currentLen -= len(x.Map822) + 1
+ currentLen += compressionLenHelper(c, x.Map822, currentLen)
+ currentLen -= len(x.Mapx400) + 1
+ currentLen += compressionLenHelper(c, x.Mapx400, currentLen)
case *RP:
- compressionLenHelper(c, x.Mbox)
- compressionLenHelper(c, x.Txt)
+ currentLen -= len(x.Mbox) + 1
+ currentLen += compressionLenHelper(c, x.Mbox, currentLen)
+ currentLen -= len(x.Txt) + 1
+ currentLen += compressionLenHelper(c, x.Txt, currentLen)
case *RRSIG:
- compressionLenHelper(c, x.SignerName)
+ currentLen -= len(x.SignerName) + 1
+ currentLen += compressionLenHelper(c, x.SignerName, currentLen)
case *RT:
- compressionLenHelper(c, x.Host)
+ currentLen -= len(x.Host) + 1
+ currentLen += compressionLenHelper(c, x.Host, currentLen)
case *SIG:
- compressionLenHelper(c, x.SignerName)
+ currentLen -= len(x.SignerName) + 1
+ currentLen += compressionLenHelper(c, x.SignerName, currentLen)
case *SOA:
- compressionLenHelper(c, x.Ns)
- compressionLenHelper(c, x.Mbox)
+ currentLen -= len(x.Ns) + 1
+ currentLen += compressionLenHelper(c, x.Ns, currentLen)
+ currentLen -= len(x.Mbox) + 1
+ currentLen += compressionLenHelper(c, x.Mbox, currentLen)
case *SRV:
- compressionLenHelper(c, x.Target)
+ currentLen -= len(x.Target) + 1
+ currentLen += compressionLenHelper(c, x.Target, currentLen)
case *TALINK:
- compressionLenHelper(c, x.PreviousName)
- compressionLenHelper(c, x.NextName)
+ currentLen -= len(x.PreviousName) + 1
+ currentLen += compressionLenHelper(c, x.PreviousName, currentLen)
+ currentLen -= len(x.NextName) + 1
+ currentLen += compressionLenHelper(c, x.NextName, currentLen)
case *TKEY:
- compressionLenHelper(c, x.Algorithm)
+ currentLen -= len(x.Algorithm) + 1
+ currentLen += compressionLenHelper(c, x.Algorithm, currentLen)
case *TSIG:
- compressionLenHelper(c, x.Algorithm)
+ currentLen -= len(x.Algorithm) + 1
+ currentLen += compressionLenHelper(c, x.Algorithm, currentLen)
}
+ return currentLen - initLen
}
-func compressionLenSearchType(c map[string]int, r RR) (int, bool) {
+func compressionLenSearchType(c map[string]int, r RR) (int, bool, int) {
switch x := r.(type) {
case *AFSDB:
- k1, ok1 := compressionLenSearch(c, x.Hostname)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Hostname)
+ return k1, ok1, sz1
case *CNAME:
- k1, ok1 := compressionLenSearch(c, x.Target)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Target)
+ return k1, ok1, sz1
case *MB:
- k1, ok1 := compressionLenSearch(c, x.Mb)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Mb)
+ return k1, ok1, sz1
case *MD:
- k1, ok1 := compressionLenSearch(c, x.Md)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Md)
+ return k1, ok1, sz1
case *MF:
- k1, ok1 := compressionLenSearch(c, x.Mf)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Mf)
+ return k1, ok1, sz1
case *MG:
- k1, ok1 := compressionLenSearch(c, x.Mg)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Mg)
+ return k1, ok1, sz1
case *MINFO:
- k1, ok1 := compressionLenSearch(c, x.Rmail)
- k2, ok2 := compressionLenSearch(c, x.Email)
- return k1 + k2, ok1 && ok2
+ k1, ok1, sz1 := compressionLenSearch(c, x.Rmail)
+ k2, ok2, sz2 := compressionLenSearch(c, x.Email)
+ return k1 + k2, ok1 && ok2, sz1 + sz2
case *MR:
- k1, ok1 := compressionLenSearch(c, x.Mr)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Mr)
+ return k1, ok1, sz1
case *MX:
- k1, ok1 := compressionLenSearch(c, x.Mx)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Mx)
+ return k1, ok1, sz1
case *NS:
- k1, ok1 := compressionLenSearch(c, x.Ns)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Ns)
+ return k1, ok1, sz1
case *PTR:
- k1, ok1 := compressionLenSearch(c, x.Ptr)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Ptr)
+ return k1, ok1, sz1
case *RT:
- k1, ok1 := compressionLenSearch(c, x.Host)
- return k1, ok1
+ k1, ok1, sz1 := compressionLenSearch(c, x.Host)
+ return k1, ok1, sz1
case *SOA:
- k1, ok1 := compressionLenSearch(c, x.Ns)
- k2, ok2 := compressionLenSearch(c, x.Mbox)
- return k1 + k2, ok1 && ok2
+ k1, ok1, sz1 := compressionLenSearch(c, x.Ns)
+ k2, ok2, sz2 := compressionLenSearch(c, x.Mbox)
+ return k1 + k2, ok1 && ok2, sz1 + sz2
}
- return 0, false
+ return 0, false, 0
}
diff --git a/vendor/github.com/miekg/dns/ztypes.go b/vendor/github.com/miekg/dns/ztypes.go
index abd75dd91..965753b11 100644
--- a/vendor/github.com/miekg/dns/ztypes.go
+++ b/vendor/github.com/miekg/dns/ztypes.go
@@ -649,215 +649,215 @@ func (rr *X25) len() int {
// copy() functions
func (rr *A) copy() RR {
- return &A{*rr.Hdr.copyHeader(), copyIP(rr.A)}
+ return &A{rr.Hdr, copyIP(rr.A)}
}
func (rr *AAAA) copy() RR {
- return &AAAA{*rr.Hdr.copyHeader(), copyIP(rr.AAAA)}
+ return &AAAA{rr.Hdr, copyIP(rr.AAAA)}
}
func (rr *AFSDB) copy() RR {
- return &AFSDB{*rr.Hdr.copyHeader(), rr.Subtype, rr.Hostname}
+ return &AFSDB{rr.Hdr, rr.Subtype, rr.Hostname}
}
func (rr *ANY) copy() RR {
- return &ANY{*rr.Hdr.copyHeader()}
+ return &ANY{rr.Hdr}
}
func (rr *AVC) copy() RR {
Txt := make([]string, len(rr.Txt))
copy(Txt, rr.Txt)
- return &AVC{*rr.Hdr.copyHeader(), Txt}
+ return &AVC{rr.Hdr, Txt}
}
func (rr *CAA) copy() RR {
- return &CAA{*rr.Hdr.copyHeader(), rr.Flag, rr.Tag, rr.Value}
+ return &CAA{rr.Hdr, rr.Flag, rr.Tag, rr.Value}
}
func (rr *CERT) copy() RR {
- return &CERT{*rr.Hdr.copyHeader(), rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate}
+ return &CERT{rr.Hdr, rr.Type, rr.KeyTag, rr.Algorithm, rr.Certificate}
}
func (rr *CNAME) copy() RR {
- return &CNAME{*rr.Hdr.copyHeader(), rr.Target}
+ return &CNAME{rr.Hdr, rr.Target}
}
func (rr *CSYNC) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap))
copy(TypeBitMap, rr.TypeBitMap)
- return &CSYNC{*rr.Hdr.copyHeader(), rr.Serial, rr.Flags, TypeBitMap}
+ return &CSYNC{rr.Hdr, rr.Serial, rr.Flags, TypeBitMap}
}
func (rr *DHCID) copy() RR {
- return &DHCID{*rr.Hdr.copyHeader(), rr.Digest}
+ return &DHCID{rr.Hdr, rr.Digest}
}
func (rr *DNAME) copy() RR {
- return &DNAME{*rr.Hdr.copyHeader(), rr.Target}
+ return &DNAME{rr.Hdr, rr.Target}
}
func (rr *DNSKEY) copy() RR {
- return &DNSKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey}
+ return &DNSKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey}
}
func (rr *DS) copy() RR {
- return &DS{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest}
+ return &DS{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest}
}
func (rr *EID) copy() RR {
- return &EID{*rr.Hdr.copyHeader(), rr.Endpoint}
+ return &EID{rr.Hdr, rr.Endpoint}
}
func (rr *EUI48) copy() RR {
- return &EUI48{*rr.Hdr.copyHeader(), rr.Address}
+ return &EUI48{rr.Hdr, rr.Address}
}
func (rr *EUI64) copy() RR {
- return &EUI64{*rr.Hdr.copyHeader(), rr.Address}
+ return &EUI64{rr.Hdr, rr.Address}
}
func (rr *GID) copy() RR {
- return &GID{*rr.Hdr.copyHeader(), rr.Gid}
+ return &GID{rr.Hdr, rr.Gid}
}
func (rr *GPOS) copy() RR {
- return &GPOS{*rr.Hdr.copyHeader(), rr.Longitude, rr.Latitude, rr.Altitude}
+ return &GPOS{rr.Hdr, rr.Longitude, rr.Latitude, rr.Altitude}
}
func (rr *HINFO) copy() RR {
- return &HINFO{*rr.Hdr.copyHeader(), rr.Cpu, rr.Os}
+ return &HINFO{rr.Hdr, rr.Cpu, rr.Os}
}
func (rr *HIP) copy() RR {
RendezvousServers := make([]string, len(rr.RendezvousServers))
copy(RendezvousServers, rr.RendezvousServers)
- return &HIP{*rr.Hdr.copyHeader(), rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers}
+ return &HIP{rr.Hdr, rr.HitLength, rr.PublicKeyAlgorithm, rr.PublicKeyLength, rr.Hit, rr.PublicKey, RendezvousServers}
}
func (rr *KX) copy() RR {
- return &KX{*rr.Hdr.copyHeader(), rr.Preference, rr.Exchanger}
+ return &KX{rr.Hdr, rr.Preference, rr.Exchanger}
}
func (rr *L32) copy() RR {
- return &L32{*rr.Hdr.copyHeader(), rr.Preference, copyIP(rr.Locator32)}
+ return &L32{rr.Hdr, rr.Preference, copyIP(rr.Locator32)}
}
func (rr *L64) copy() RR {
- return &L64{*rr.Hdr.copyHeader(), rr.Preference, rr.Locator64}
+ return &L64{rr.Hdr, rr.Preference, rr.Locator64}
}
func (rr *LOC) copy() RR {
- return &LOC{*rr.Hdr.copyHeader(), rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude}
+ return &LOC{rr.Hdr, rr.Version, rr.Size, rr.HorizPre, rr.VertPre, rr.Latitude, rr.Longitude, rr.Altitude}
}
func (rr *LP) copy() RR {
- return &LP{*rr.Hdr.copyHeader(), rr.Preference, rr.Fqdn}
+ return &LP{rr.Hdr, rr.Preference, rr.Fqdn}
}
func (rr *MB) copy() RR {
- return &MB{*rr.Hdr.copyHeader(), rr.Mb}
+ return &MB{rr.Hdr, rr.Mb}
}
func (rr *MD) copy() RR {
- return &MD{*rr.Hdr.copyHeader(), rr.Md}
+ return &MD{rr.Hdr, rr.Md}
}
func (rr *MF) copy() RR {
- return &MF{*rr.Hdr.copyHeader(), rr.Mf}
+ return &MF{rr.Hdr, rr.Mf}
}
func (rr *MG) copy() RR {
- return &MG{*rr.Hdr.copyHeader(), rr.Mg}
+ return &MG{rr.Hdr, rr.Mg}
}
func (rr *MINFO) copy() RR {
- return &MINFO{*rr.Hdr.copyHeader(), rr.Rmail, rr.Email}
+ return &MINFO{rr.Hdr, rr.Rmail, rr.Email}
}
func (rr *MR) copy() RR {
- return &MR{*rr.Hdr.copyHeader(), rr.Mr}
+ return &MR{rr.Hdr, rr.Mr}
}
func (rr *MX) copy() RR {
- return &MX{*rr.Hdr.copyHeader(), rr.Preference, rr.Mx}
+ return &MX{rr.Hdr, rr.Preference, rr.Mx}
}
func (rr *NAPTR) copy() RR {
- return &NAPTR{*rr.Hdr.copyHeader(), rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement}
+ return &NAPTR{rr.Hdr, rr.Order, rr.Preference, rr.Flags, rr.Service, rr.Regexp, rr.Replacement}
}
func (rr *NID) copy() RR {
- return &NID{*rr.Hdr.copyHeader(), rr.Preference, rr.NodeID}
+ return &NID{rr.Hdr, rr.Preference, rr.NodeID}
}
func (rr *NIMLOC) copy() RR {
- return &NIMLOC{*rr.Hdr.copyHeader(), rr.Locator}
+ return &NIMLOC{rr.Hdr, rr.Locator}
}
func (rr *NINFO) copy() RR {
ZSData := make([]string, len(rr.ZSData))
copy(ZSData, rr.ZSData)
- return &NINFO{*rr.Hdr.copyHeader(), ZSData}
+ return &NINFO{rr.Hdr, ZSData}
}
func (rr *NS) copy() RR {
- return &NS{*rr.Hdr.copyHeader(), rr.Ns}
+ return &NS{rr.Hdr, rr.Ns}
}
func (rr *NSAPPTR) copy() RR {
- return &NSAPPTR{*rr.Hdr.copyHeader(), rr.Ptr}
+ return &NSAPPTR{rr.Hdr, rr.Ptr}
}
func (rr *NSEC) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap))
copy(TypeBitMap, rr.TypeBitMap)
- return &NSEC{*rr.Hdr.copyHeader(), rr.NextDomain, TypeBitMap}
+ return &NSEC{rr.Hdr, rr.NextDomain, TypeBitMap}
}
func (rr *NSEC3) copy() RR {
TypeBitMap := make([]uint16, len(rr.TypeBitMap))
copy(TypeBitMap, rr.TypeBitMap)
- return &NSEC3{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap}
+ return &NSEC3{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt, rr.HashLength, rr.NextDomain, TypeBitMap}
}
func (rr *NSEC3PARAM) copy() RR {
- return &NSEC3PARAM{*rr.Hdr.copyHeader(), rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt}
+ return &NSEC3PARAM{rr.Hdr, rr.Hash, rr.Flags, rr.Iterations, rr.SaltLength, rr.Salt}
}
func (rr *OPENPGPKEY) copy() RR {
- return &OPENPGPKEY{*rr.Hdr.copyHeader(), rr.PublicKey}
+ return &OPENPGPKEY{rr.Hdr, rr.PublicKey}
}
func (rr *OPT) copy() RR {
Option := make([]EDNS0, len(rr.Option))
copy(Option, rr.Option)
- return &OPT{*rr.Hdr.copyHeader(), Option}
+ return &OPT{rr.Hdr, Option}
}
func (rr *PTR) copy() RR {
- return &PTR{*rr.Hdr.copyHeader(), rr.Ptr}
+ return &PTR{rr.Hdr, rr.Ptr}
}
func (rr *PX) copy() RR {
- return &PX{*rr.Hdr.copyHeader(), rr.Preference, rr.Map822, rr.Mapx400}
+ return &PX{rr.Hdr, rr.Preference, rr.Map822, rr.Mapx400}
}
func (rr *RFC3597) copy() RR {
- return &RFC3597{*rr.Hdr.copyHeader(), rr.Rdata}
+ return &RFC3597{rr.Hdr, rr.Rdata}
}
func (rr *RKEY) copy() RR {
- return &RKEY{*rr.Hdr.copyHeader(), rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey}
+ return &RKEY{rr.Hdr, rr.Flags, rr.Protocol, rr.Algorithm, rr.PublicKey}
}
func (rr *RP) copy() RR {
- return &RP{*rr.Hdr.copyHeader(), rr.Mbox, rr.Txt}
+ return &RP{rr.Hdr, rr.Mbox, rr.Txt}
}
func (rr *RRSIG) copy() RR {
- return &RRSIG{*rr.Hdr.copyHeader(), rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature}
+ return &RRSIG{rr.Hdr, rr.TypeCovered, rr.Algorithm, rr.Labels, rr.OrigTtl, rr.Expiration, rr.Inception, rr.KeyTag, rr.SignerName, rr.Signature}
}
func (rr *RT) copy() RR {
- return &RT{*rr.Hdr.copyHeader(), rr.Preference, rr.Host}
+ return &RT{rr.Hdr, rr.Preference, rr.Host}
}
func (rr *SMIMEA) copy() RR {
- return &SMIMEA{*rr.Hdr.copyHeader(), rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate}
+ return &SMIMEA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate}
}
func (rr *SOA) copy() RR {
- return &SOA{*rr.Hdr.copyHeader(), rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl}
+ return &SOA{rr.Hdr, rr.Ns, rr.Mbox, rr.Serial, rr.Refresh, rr.Retry, rr.Expire, rr.Minttl}
}
func (rr *SPF) copy() RR {
Txt := make([]string, len(rr.Txt))
copy(Txt, rr.Txt)
- return &SPF{*rr.Hdr.copyHeader(), Txt}
+ return &SPF{rr.Hdr, Txt}
}
func (rr *SRV) copy() RR {
- return &SRV{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Port, rr.Target}
+ return &SRV{rr.Hdr, rr.Priority, rr.Weight, rr.Port, rr.Target}
}
func (rr *SSHFP) copy() RR {
- return &SSHFP{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Type, rr.FingerPrint}
+ return &SSHFP{rr.Hdr, rr.Algorithm, rr.Type, rr.FingerPrint}
}
func (rr *TA) copy() RR {
- return &TA{*rr.Hdr.copyHeader(), rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest}
+ return &TA{rr.Hdr, rr.KeyTag, rr.Algorithm, rr.DigestType, rr.Digest}
}
func (rr *TALINK) copy() RR {
- return &TALINK{*rr.Hdr.copyHeader(), rr.PreviousName, rr.NextName}
+ return &TALINK{rr.Hdr, rr.PreviousName, rr.NextName}
}
func (rr *TKEY) copy() RR {
- return &TKEY{*rr.Hdr.copyHeader(), rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData}
+ return &TKEY{rr.Hdr, rr.Algorithm, rr.Inception, rr.Expiration, rr.Mode, rr.Error, rr.KeySize, rr.Key, rr.OtherLen, rr.OtherData}
}
func (rr *TLSA) copy() RR {
- return &TLSA{*rr.Hdr.copyHeader(), rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate}
+ return &TLSA{rr.Hdr, rr.Usage, rr.Selector, rr.MatchingType, rr.Certificate}
}
func (rr *TSIG) copy() RR {
- return &TSIG{*rr.Hdr.copyHeader(), rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData}
+ return &TSIG{rr.Hdr, rr.Algorithm, rr.TimeSigned, rr.Fudge, rr.MACSize, rr.MAC, rr.OrigId, rr.Error, rr.OtherLen, rr.OtherData}
}
func (rr *TXT) copy() RR {
Txt := make([]string, len(rr.Txt))
copy(Txt, rr.Txt)
- return &TXT{*rr.Hdr.copyHeader(), Txt}
+ return &TXT{rr.Hdr, Txt}
}
func (rr *UID) copy() RR {
- return &UID{*rr.Hdr.copyHeader(), rr.Uid}
+ return &UID{rr.Hdr, rr.Uid}
}
func (rr *UINFO) copy() RR {
- return &UINFO{*rr.Hdr.copyHeader(), rr.Uinfo}
+ return &UINFO{rr.Hdr, rr.Uinfo}
}
func (rr *URI) copy() RR {
- return &URI{*rr.Hdr.copyHeader(), rr.Priority, rr.Weight, rr.Target}
+ return &URI{rr.Hdr, rr.Priority, rr.Weight, rr.Target}
}
func (rr *X25) copy() RR {
- return &X25{*rr.Hdr.copyHeader(), rr.PSDNAddress}
+ return &X25{rr.Hdr, rr.PSDNAddress}
}
diff --git a/vendor/github.com/minio/minio-go/api-compose-object.go b/vendor/github.com/minio/minio-go/api-compose-object.go
index 99b2adae8..5d3ede70d 100644
--- a/vendor/github.com/minio/minio-go/api-compose-object.go
+++ b/vendor/github.com/minio/minio-go/api-compose-object.go
@@ -1,6 +1,6 @@
/*
* Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
+ * Copyright 2017, 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,8 @@ package minio
import (
"context"
"fmt"
+ "io"
+ "io/ioutil"
"net/http"
"net/url"
"strconv"
@@ -343,11 +345,12 @@ func (c Client) uploadPartCopy(ctx context.Context, bucket, object, uploadID str
return p, nil
}
-// ComposeObject - creates an object using server-side copying of
+// ComposeObjectWithProgress - creates an object using server-side copying of
// existing objects. It takes a list of source objects (with optional
// offsets) and concatenates them into a new object using only
-// server-side copying operations.
-func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {
+// server-side copying operations. Optionally takes progress reader hook
+// for applications to look at current progress.
+func (c Client) ComposeObjectWithProgress(dst DestinationInfo, srcs []SourceInfo, progress io.Reader) error {
if len(srcs) < 1 || len(srcs) > maxPartsCount {
return ErrInvalidArgument("There must be as least one and up to 10000 source objects.")
}
@@ -421,7 +424,7 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {
// involved, it is being copied wholly and at most 5GiB in
// size, emptyfiles are also supported).
if (totalParts == 1 && srcs[0].start == -1 && totalSize <= maxPartSize) || (totalSize == 0) {
- return c.CopyObject(dst, srcs[0])
+ return c.CopyObjectWithProgress(dst, srcs[0], progress)
}
// Now, handle multipart-copy cases.
@@ -476,6 +479,9 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {
if err != nil {
return err
}
+ if progress != nil {
+ io.CopyN(ioutil.Discard, progress, start+end-1)
+ }
objParts = append(objParts, complPart)
partIndex++
}
@@ -490,10 +496,20 @@ func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {
return nil
}
-// partsRequired is ceiling(size / copyPartSize)
+// ComposeObject - creates an object using server-side copying of
+// existing objects. It takes a list of source objects (with optional
+// offsets) and concatenates them into a new object using only
+// server-side copying operations.
+func (c Client) ComposeObject(dst DestinationInfo, srcs []SourceInfo) error {
+ return c.ComposeObjectWithProgress(dst, srcs, nil)
+}
+
+// partsRequired is maximum parts possible with
+// max part size of ceiling(maxMultipartPutObjectSize / (maxPartsCount - 1))
func partsRequired(size int64) int64 {
- r := size / copyPartSize
- if size%copyPartSize > 0 {
+ maxPartSize := maxMultipartPutObjectSize / (maxPartsCount - 1)
+ r := size / int64(maxPartSize)
+ if size%int64(maxPartSize) > 0 {
r++
}
return r
diff --git a/vendor/github.com/minio/minio-go/api-put-bucket.go b/vendor/github.com/minio/minio-go/api-put-bucket.go
index 8920ac742..cb9d8f27a 100644
--- a/vendor/github.com/minio/minio-go/api-put-bucket.go
+++ b/vendor/github.com/minio/minio-go/api-put-bucket.go
@@ -99,13 +99,17 @@ func (c Client) MakeBucket(bucketName string, location string) (err error) {
}
// SetBucketPolicy set the access permissions on an existing bucket.
-//
func (c Client) SetBucketPolicy(bucketName, policy string) error {
// Input validation.
if err := s3utils.CheckValidBucketName(bucketName); err != nil {
return err
}
+ // If policy is empty then delete the bucket policy.
+ if policy == "" {
+ return c.removeBucketPolicy(bucketName)
+ }
+
// Save the updated policies.
return c.putBucketPolicy(bucketName, policy)
}
diff --git a/vendor/github.com/minio/minio-go/api-put-object-copy.go b/vendor/github.com/minio/minio-go/api-put-object-copy.go
index acd195fcd..21322ef6a 100644
--- a/vendor/github.com/minio/minio-go/api-put-object-copy.go
+++ b/vendor/github.com/minio/minio-go/api-put-object-copy.go
@@ -1,6 +1,6 @@
/*
* Minio Go Library for Amazon S3 Compatible Cloud Storage
- * Copyright 2017 Minio, Inc.
+ * Copyright 2017, 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@ package minio
import (
"context"
+ "io"
+ "io/ioutil"
"net/http"
"github.com/minio/minio-go/pkg/encrypt"
@@ -26,13 +28,31 @@ import (
// CopyObject - copy a source object into a new object
func (c Client) CopyObject(dst DestinationInfo, src SourceInfo) error {
+ return c.CopyObjectWithProgress(dst, src, nil)
+}
+
+// CopyObjectWithProgress - copy a source object into a new object, optionally takes
+// progress bar input to notify current progress.
+func (c Client) CopyObjectWithProgress(dst DestinationInfo, src SourceInfo, progress io.Reader) error {
header := make(http.Header)
for k, v := range src.Headers {
header[k] = v
}
+
+ var err error
+ var size int64
+ // If progress bar is specified, size should be requested as well initiate a StatObject request.
+ if progress != nil {
+ size, _, _, err = src.getProps(c)
+ if err != nil {
+ return err
+ }
+ }
+
if src.encryption != nil {
encrypt.SSECopy(src.encryption).Marshal(header)
}
+
if dst.encryption != nil {
dst.encryption.Marshal(header)
}
@@ -53,5 +73,11 @@ func (c Client) CopyObject(dst DestinationInfo, src SourceInfo) error {
if resp.StatusCode != http.StatusOK {
return httpRespToErrorResponse(resp, dst.bucket, dst.object)
}
+
+ // Update the progress properly after successful copy.
+ if progress != nil {
+ io.CopyN(ioutil.Discard, progress, size)
+ }
+
return nil
}
diff --git a/vendor/github.com/minio/minio-go/api-put-object.go b/vendor/github.com/minio/minio-go/api-put-object.go
index 2402a7167..45ae11d6c 100644
--- a/vendor/github.com/minio/minio-go/api-put-object.go
+++ b/vendor/github.com/minio/minio-go/api-put-object.go
@@ -33,16 +33,17 @@ import (
// PutObjectOptions represents options specified by user for PutObject call
type PutObjectOptions struct {
- UserMetadata map[string]string
- Progress io.Reader
- ContentType string
- ContentEncoding string
- ContentDisposition string
- ContentLanguage string
- CacheControl string
- ServerSideEncryption encrypt.ServerSide
- NumThreads uint
- StorageClass string
+ UserMetadata map[string]string
+ Progress io.Reader
+ ContentType string
+ ContentEncoding string
+ ContentDisposition string
+ ContentLanguage string
+ CacheControl string
+ ServerSideEncryption encrypt.ServerSide
+ NumThreads uint
+ StorageClass string
+ WebsiteRedirectLocation string
}
// getNumThreads - gets the number of threads to be used in the multipart
@@ -84,6 +85,9 @@ func (opts PutObjectOptions) Header() (header http.Header) {
if opts.StorageClass != "" {
header[amzStorageClass] = []string{opts.StorageClass}
}
+ if opts.WebsiteRedirectLocation != "" {
+ header[amzWebsiteRedirectLocation] = []string{opts.WebsiteRedirectLocation}
+ }
for k, v := range opts.UserMetadata {
if !isAmzHeader(k) && !isStandardHeader(k) && !isStorageClassHeader(k) {
header["X-Amz-Meta-"+k] = []string{v}
diff --git a/vendor/github.com/minio/minio-go/api-stat.go b/vendor/github.com/minio/minio-go/api-stat.go
index 5356f8a4f..3b054c34a 100644
--- a/vendor/github.com/minio/minio-go/api-stat.go
+++ b/vendor/github.com/minio/minio-go/api-stat.go
@@ -66,6 +66,9 @@ var defaultFilterKeys = []string{
"x-amz-bucket-region",
"x-amz-request-id",
"x-amz-id-2",
+ "Content-Security-Policy",
+ "X-Xss-Protection",
+
// Add new headers to be ignored.
}
diff --git a/vendor/github.com/minio/minio-go/api.go b/vendor/github.com/minio/minio-go/api.go
index daf3ec2c2..03778b04c 100644
--- a/vendor/github.com/minio/minio-go/api.go
+++ b/vendor/github.com/minio/minio-go/api.go
@@ -99,7 +99,7 @@ type Options struct {
// Global constants.
const (
libraryName = "minio-go"
- libraryVersion = "6.0.0"
+ libraryVersion = "6.0.1"
)
// User Agent should always following the below style.
diff --git a/vendor/github.com/minio/minio-go/constants.go b/vendor/github.com/minio/minio-go/constants.go
index 7db5a99af..737742318 100644
--- a/vendor/github.com/minio/minio-go/constants.go
+++ b/vendor/github.com/minio/minio-go/constants.go
@@ -27,10 +27,6 @@ const absMinPartSize = 1024 * 1024 * 5
// putObject behaves internally as multipart.
const minPartSize = 1024 * 1024 * 64
-// copyPartSize - default (and maximum) part size to copy in a
-// copy-object request (5GiB)
-const copyPartSize = 1024 * 1024 * 1024 * 5
-
// maxPartsCount - maximum number of parts for a single multipart session.
const maxPartsCount = 10000
@@ -61,3 +57,6 @@ const (
// Storage class header constant.
const amzStorageClass = "X-Amz-Storage-Class"
+
+// Website redirect location header constant
+const amzWebsiteRedirectLocation = "X-Amz-Website-Redirect-Location"
diff --git a/vendor/github.com/minio/minio-go/core.go b/vendor/github.com/minio/minio-go/core.go
index cf2ba0537..31dbcd12e 100644
--- a/vendor/github.com/minio/minio-go/core.go
+++ b/vendor/github.com/minio/minio-go/core.go
@@ -82,6 +82,8 @@ func (c Core) PutObject(bucket, object string, data io.Reader, size int64, md5Ba
opts.ContentType = v
} else if strings.ToLower(k) == "cache-control" {
opts.CacheControl = v
+ } else if strings.ToLower(k) == strings.ToLower(amzWebsiteRedirectLocation) {
+ opts.WebsiteRedirectLocation = v
} else {
m[k] = metadata[k]
}
diff --git a/vendor/github.com/minio/minio-go/functional_tests.go b/vendor/github.com/minio/minio-go/functional_tests.go
index c8236d69b..421b30e8e 100644
--- a/vendor/github.com/minio/minio-go/functional_tests.go
+++ b/vendor/github.com/minio/minio-go/functional_tests.go
@@ -3474,15 +3474,13 @@ func testFunctional() {
function = "SetBucketPolicy(bucketName, readOnlyPolicy)"
functionAll += ", " + function
- readOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Action":["s3:ListBucket"],"Effect":"Allow","Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::` + bucketName + `"],"Sid":""}]}`
-
+ readOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucket"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
args = map[string]interface{}{
"bucketName": bucketName,
"bucketPolicy": readOnlyPolicy,
}
err = c.SetBucketPolicy(bucketName, readOnlyPolicy)
-
if err != nil {
logError(testName, function, args, startTime, "", "SetBucketPolicy failed", err)
return
@@ -3494,14 +3492,12 @@ func testFunctional() {
"bucketName": bucketName,
}
readOnlyPolicyRet, err := c.GetBucketPolicy(bucketName)
-
if err != nil {
logError(testName, function, args, startTime, "", "GetBucketPolicy failed", err)
return
}
-
- if strings.Compare(readOnlyPolicyRet, readOnlyPolicy) != 0 {
- logError(testName, function, args, startTime, "", "policy should be set to readonly", err)
+ if readOnlyPolicyRet == "" {
+ logError(testName, function, args, startTime, "", "policy should be set", err)
return
}
@@ -3509,8 +3505,7 @@ func testFunctional() {
function = "SetBucketPolicy(bucketName, writeOnlyPolicy)"
functionAll += ", " + function
- writeOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Action":["s3:ListBucketMultipartUploads"],"Effect":"Allow","Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::` + bucketName + `"],"Sid":""}]}`
-
+ writeOnlyPolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucketMultipartUploads"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
args = map[string]interface{}{
"bucketName": bucketName,
"bucketPolicy": writeOnlyPolicy,
@@ -3534,8 +3529,8 @@ func testFunctional() {
return
}
- if strings.Compare(writeOnlyPolicyRet, writeOnlyPolicy) != 0 {
- logError(testName, function, args, startTime, "", "policy should be set to writeonly", err)
+ if writeOnlyPolicyRet == "" {
+ logError(testName, function, args, startTime, "", "policy should be set", err)
return
}
@@ -3543,7 +3538,7 @@ func testFunctional() {
function = "SetBucketPolicy(bucketName, readWritePolicy)"
functionAll += ", " + function
- readWritePolicy := `{"Version":"2012-10-17","Statement":[{"Action":["s3:ListBucket","s3:ListBucketMultipartUploads"],"Effect":"Allow","Principal":{"AWS":["*"]},"Resource":["arn:aws:s3:::` + bucketName + `"],"Sid":""}]}`
+ readWritePolicy := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":["*"]},"Action":["s3:ListBucket","s3:ListBucketMultipartUploads"],"Resource":["arn:aws:s3:::` + bucketName + `"]}]}`
args = map[string]interface{}{
"bucketName": bucketName,
@@ -3567,8 +3562,8 @@ func testFunctional() {
return
}
- if strings.Compare(readWritePolicyRet, readWritePolicy) != 0 {
- logError(testName, function, args, startTime, "", "policy should be set to readwrite", err)
+ if readWritePolicyRet == "" {
+ logError(testName, function, args, startTime, "", "policy should be set", err)
return
}
@@ -5995,7 +5990,11 @@ func testStorageClassMetadataPutObject() {
logError(testName, function, args, startTime, "", "Metadata verification failed, STANDARD storage class should not be a part of response metadata", err)
return
}
-
+ // Delete all objects and buckets
+ if err = cleanupBucket(bucketName, c); err != nil {
+ logError(testName, function, args, startTime, "", "Cleanup failed", err)
+ return
+ }
successLogger(testName, function, args, startTime).Info()
}
@@ -6036,7 +6035,11 @@ func testStorageClassInvalidMetadataPutObject() {
logError(testName, function, args, startTime, "", "PutObject with invalid storage class passed, was expected to fail", err)
return
}
-
+ // Delete all objects and buckets
+ if err = cleanupBucket(bucketName, c); err != nil {
+ logError(testName, function, args, startTime, "", "Cleanup failed", err)
+ return
+ }
successLogger(testName, function, args, startTime).Info()
}
@@ -6136,7 +6139,11 @@ func testStorageClassMetadataCopyObject() {
logError(testName, function, args, startTime, "", "Metadata verification failed, STANDARD storage class should not be a part of response metadata", err)
return
}
-
+ // Delete all objects and buckets
+ if err = cleanupBucket(bucketName, c); err != nil {
+ logError(testName, function, args, startTime, "", "Cleanup failed", err)
+ return
+ }
successLogger(testName, function, args, startTime).Info()
}
@@ -6497,7 +6504,7 @@ func testFunctionalV2() {
function = "SetBucketPolicy(bucketName, bucketPolicy)"
functionAll += ", " + function
- readWritePolicy := `{"Version": "2012-10-17","Statement": [{"Action": ["s3:ListBucketMultipartUploads,s3:ListBucket"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::` + bucketName + `/*"],"Sid": ""}]}`
+ readWritePolicy := `{"Version": "2012-10-17","Statement": [{"Action": ["s3:ListBucketMultipartUploads", "s3:ListBucket"],"Effect": "Allow","Principal": {"AWS": ["*"]},"Resource": ["arn:aws:s3:::` + bucketName + `"],"Sid": ""}]}`
args = map[string]interface{}{
"bucketName": bucketName,
@@ -6558,9 +6565,9 @@ func testFunctionalV2() {
return
}
- objectName_noLength := objectName + "-nolength"
- args["objectName"] = objectName_noLength
- n, err = c.PutObject(bucketName, objectName_noLength, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
+ objectNameNoLength := objectName + "-nolength"
+ args["objectName"] = objectNameNoLength
+ n, err = c.PutObject(bucketName, objectNameNoLength, bytes.NewReader(buf), int64(len(buf)), minio.PutObjectOptions{ContentType: "binary/octet-stream"})
if err != nil {
logError(testName, function, args, startTime, "", "PutObject failed", err)
return
diff --git a/vendor/github.com/minio/minio-go/retry.go b/vendor/github.com/minio/minio-go/retry.go
index 49d6dcdf5..22c94347e 100644
--- a/vendor/github.com/minio/minio-go/retry.go
+++ b/vendor/github.com/minio/minio-go/retry.go
@@ -131,6 +131,7 @@ var retryableS3Codes = map[string]struct{}{
"InternalError": {},
"ExpiredToken": {},
"ExpiredTokenException": {},
+ "SlowDown": {},
// Add more AWS S3 codes here.
}
diff --git a/vendor/github.com/minio/minio-go/utils.go b/vendor/github.com/minio/minio-go/utils.go
index 2f02ac89f..f80e25c41 100644
--- a/vendor/github.com/minio/minio-go/utils.go
+++ b/vendor/github.com/minio/minio-go/utils.go
@@ -222,6 +222,7 @@ var supportedHeaders = []string{
"content-encoding",
"content-disposition",
"content-language",
+ "x-amz-website-redirect-location",
// Add more supported headers here.
}
diff --git a/vendor/github.com/mitchellh/mapstructure/mapstructure.go b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
index aaf12a295..13cc5e3d6 100644
--- a/vendor/github.com/mitchellh/mapstructure/mapstructure.go
+++ b/vendor/github.com/mitchellh/mapstructure/mapstructure.go
@@ -644,16 +644,28 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re
return fmt.Errorf("cannot assign type '%s' to map value field of type '%s'", v.Type(), valMap.Type().Elem())
}
+ tagValue := f.Tag.Get(d.config.TagName)
+ tagParts := strings.Split(tagValue, ",")
+
// Determine the name of the key in the map
keyName := f.Name
- tagValue := f.Tag.Get(d.config.TagName)
- tagValue = strings.SplitN(tagValue, ",", 2)[0]
- if tagValue != "" {
- if tagValue == "-" {
+ if tagParts[0] != "" {
+ if tagParts[0] == "-" {
continue
}
+ keyName = tagParts[0]
+ }
- keyName = tagValue
+ // If "squash" is specified in the tag, we squash the field down.
+ squash := false
+ for _, tag := range tagParts[1:] {
+ if tag == "squash" {
+ squash = true
+ break
+ }
+ }
+ if squash && v.Kind() != reflect.Struct {
+ return fmt.Errorf("cannot squash non-struct type '%s'", v.Type())
}
switch v.Kind() {
@@ -673,7 +685,13 @@ func (d *Decoder) decodeMapFromStruct(name string, dataVal reflect.Value, val re
return err
}
- valMap.SetMapIndex(reflect.ValueOf(keyName), vMap)
+ if squash {
+ for _, k := range vMap.MapKeys() {
+ valMap.SetMapIndex(k, vMap.MapIndex(k))
+ }
+ } else {
+ valMap.SetMapIndex(reflect.ValueOf(keyName), vMap)
+ }
default:
valMap.SetMapIndex(reflect.ValueOf(keyName), v)
diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go
index 291eae7d8..8fa8f486f 100644
--- a/vendor/github.com/spf13/cobra/bash_completions.go
+++ b/vendor/github.com/spf13/cobra/bash_completions.go
@@ -251,6 +251,14 @@ __%[1]s_handle_word()
__%[1]s_handle_command
elif [[ $c -eq 0 ]]; then
__%[1]s_handle_command
+ elif __%[1]s_contains_word "${words[c]}" "${command_aliases[@]}"; then
+ # aliashash variable is an associative array which is only supported in bash > 3.
+ if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then
+ words[c]=${aliashash[${words[c]}]}
+ __%[1]s_handle_command
+ else
+ __%[1]s_handle_noun
+ fi
else
__%[1]s_handle_noun
fi
@@ -266,6 +274,7 @@ func writePostscript(buf *bytes.Buffer, name string) {
buf.WriteString(fmt.Sprintf(`{
local cur prev words cword
declare -A flaghash 2>/dev/null || :
+ declare -A aliashash 2>/dev/null || :
if declare -F _init_completion >/dev/null 2>&1; then
_init_completion -s || return
else
@@ -305,6 +314,7 @@ func writeCommands(buf *bytes.Buffer, cmd *Command) {
continue
}
buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name()))
+ writeCmdAliases(buf, c)
}
buf.WriteString("\n")
}
@@ -443,6 +453,21 @@ func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) {
}
}
+func writeCmdAliases(buf *bytes.Buffer, cmd *Command) {
+ if len(cmd.Aliases) == 0 {
+ return
+ }
+
+ sort.Sort(sort.StringSlice(cmd.Aliases))
+
+ buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n"))
+ for _, value := range cmd.Aliases {
+ buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value))
+ buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name()))
+ }
+ buf.WriteString(` fi`)
+ buf.WriteString("\n")
+}
func writeArgAliases(buf *bytes.Buffer, cmd *Command) {
buf.WriteString(" noun_aliases=()\n")
sort.Sort(sort.StringSlice(cmd.ArgAliases))
@@ -469,6 +494,10 @@ func gen(buf *bytes.Buffer, cmd *Command) {
}
buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName))
+ buf.WriteString("\n")
+ buf.WriteString(" command_aliases=()\n")
+ buf.WriteString("\n")
+
writeCommands(buf, cmd)
writeFlags(buf, cmd)
writeRequiredFlag(buf, cmd)
diff --git a/vendor/github.com/spf13/cobra/bash_completions.md b/vendor/github.com/spf13/cobra/bash_completions.md
index 8d01f456f..e79d4769d 100644
--- a/vendor/github.com/spf13/cobra/bash_completions.md
+++ b/vendor/github.com/spf13/cobra/bash_completions.md
@@ -181,7 +181,7 @@ a custom flag completion function with cobra.BashCompCustom:
```go
annotation := make(map[string][]string)
- annotation[cobra.BashCompFilenameExt] = []string{"__kubectl_get_namespaces"}
+ annotation[cobra.BashCompCustom] = []string{"__kubectl_get_namespaces"}
flag := &pflag.Flag{
Name: "namespace",
diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go
index 15b811279..34d1bf367 100644
--- a/vendor/github.com/spf13/cobra/command.go
+++ b/vendor/github.com/spf13/cobra/command.go
@@ -27,6 +27,9 @@ import (
flag "github.com/spf13/pflag"
)
+// FParseErrWhitelist configures Flag parse errors to be ignored
+type FParseErrWhitelist flag.ParseErrorsWhitelist
+
// Command is just that, a command for your application.
// E.g. 'go run ...' - 'run' is the command. Cobra requires
// you to define the usage and description as part of your command
@@ -137,6 +140,9 @@ type Command struct {
// TraverseChildren parses flags on all parents before executing child command.
TraverseChildren bool
+ //FParseErrWhitelist flag parse errors to be ignored
+ FParseErrWhitelist FParseErrWhitelist
+
// commands is the list of commands supported by this program.
commands []*Command
// parent is a parent command for this command.
@@ -1463,6 +1469,10 @@ func (c *Command) ParseFlags(args []string) error {
}
beforeErrorBufLen := c.flagErrorBuf.Len()
c.mergePersistentFlags()
+
+ //do it here after merging all flags and just before parse
+ c.Flags().ParseErrorsWhitelist = flag.ParseErrorsWhitelist(c.FParseErrWhitelist)
+
err := c.Flags().Parse(args)
// Print warnings if they occurred (e.g. deprecated flag messages).
if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil {
diff --git a/vendor/go.uber.org/atomic/atomic.go b/vendor/go.uber.org/atomic/atomic.go
index 1ca50dc34..1db6849fc 100644
--- a/vendor/go.uber.org/atomic/atomic.go
+++ b/vendor/go.uber.org/atomic/atomic.go
@@ -25,6 +25,7 @@ package atomic
import (
"math"
"sync/atomic"
+ "time"
)
// Int32 is an atomic wrapper around an int32.
@@ -304,6 +305,47 @@ func (f *Float64) CAS(old, new float64) bool {
return atomic.CompareAndSwapUint64(&f.v, math.Float64bits(old), math.Float64bits(new))
}
+// Duration is an atomic wrapper around time.Duration
+// https://godoc.org/time#Duration
+type Duration struct {
+ v Int64
+}
+
+// NewDuration creates a Duration.
+func NewDuration(d time.Duration) *Duration {
+ return &Duration{v: *NewInt64(int64(d))}
+}
+
+// Load atomically loads the wrapped value.
+func (d *Duration) Load() time.Duration {
+ return time.Duration(d.v.Load())
+}
+
+// Store atomically stores the passed value.
+func (d *Duration) Store(n time.Duration) {
+ d.v.Store(int64(n))
+}
+
+// Add atomically adds to the wrapped time.Duration and returns the new value.
+func (d *Duration) Add(n time.Duration) time.Duration {
+ return time.Duration(d.v.Add(int64(n)))
+}
+
+// Sub atomically subtracts from the wrapped time.Duration and returns the new value.
+func (d *Duration) Sub(n time.Duration) time.Duration {
+ return time.Duration(d.v.Sub(int64(n)))
+}
+
+// Swap atomically swaps the wrapped time.Duration and returns the old value.
+func (d *Duration) Swap(n time.Duration) time.Duration {
+ return time.Duration(d.v.Swap(int64(n)))
+}
+
+// CAS is an atomic compare-and-swap.
+func (d *Duration) CAS(old, new time.Duration) bool {
+ return d.v.CAS(int64(old), int64(new))
+}
+
// Value shadows the type of the same name from sync/atomic
// https://godoc.org/sync/atomic#Value
type Value struct{ atomic.Value }
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
index bb2b0d8b4..2fc1ec031 100644
--- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.go
@@ -6,14 +6,13 @@
package argon2
+import "golang.org/x/sys/cpu"
+
func init() {
- useSSE4 = supportsSSE4()
+ useSSE4 = cpu.X86.HasSSE41
}
//go:noescape
-func supportsSSE4() bool
-
-//go:noescape
func mixBlocksSSE2(out, a, b, c *block)
//go:noescape
diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
index 8a83f7c73..74a6e7332 100644
--- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
+++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s
@@ -241,12 +241,3 @@ loop:
SUBQ $2, BP
JA loop
RET
-
-// func supportsSSE4() bool
-TEXT ·supportsSSE4(SB), 4, $0-1
- MOVL $1, AX
- CPUID
- SHRL $19, CX // Bit 19 indicates SSE4 support
- ANDL $1, CX // CX != 0 if support SSE4
- MOVB CX, ret+0(FP)
- RET
diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go
index a1e08d7ef..4d31dd0fd 100644
--- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go
+++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go
@@ -6,21 +6,12 @@
package blake2b
-import _ "unsafe"
-
-//go:linkname x86_HasAVX internal/cpu.X86.HasAVX
-var x86_HasAVX bool
-
-//go:linkname x86_HasAVX2 internal/cpu.X86.HasAVX2
-var x86_HasAVX2 bool
-
-//go:linkname x86_HasAVX internal/cpu.X86.HasSSE4
-var x86_HasSSE4 bool
+import "golang.org/x/sys/cpu"
func init() {
- useAVX2 = x86_HasAVX2
- useAVX = x86_HasAVX
- useSSE4 = x86_HasSSE4
+ useAVX2 = cpu.X86.HasAVX2
+ useAVX = cpu.X86.HasAVX
+ useSSE4 = cpu.X86.HasSSE41
}
//go:noescape
@@ -33,13 +24,14 @@ func hashBlocksAVX(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
- if useAVX2 {
+ switch {
+ case useAVX2:
hashBlocksAVX2(h, c, flag, blocks)
- } else if useAVX {
+ case useAVX:
hashBlocksAVX(h, c, flag, blocks)
- } else if useSSE4 {
+ case useSSE4:
hashBlocksSSE4(h, c, flag, blocks)
- } else {
+ default:
hashBlocksGeneric(h, c, flag, blocks)
}
}
diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go
index 2ab7c30fc..30e2fcd58 100644
--- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go
+++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go
@@ -6,14 +6,13 @@
package blake2b
+import "golang.org/x/sys/cpu"
+
func init() {
- useSSE4 = supportsSSE4()
+ useSSE4 = cpu.X86.HasSSE41
}
//go:noescape
-func supportsSSE4() bool
-
-//go:noescape
func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte)
func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) {
diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s
index 64530740b..578e947b3 100644
--- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s
+++ b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.s
@@ -279,12 +279,3 @@ noinc:
MOVQ BP, SP
RET
-
-// func supportsSSE4() bool
-TEXT ·supportsSSE4(SB), 4, $0-1
- MOVL $1, AX
- CPUID
- SHRL $19, CX // Bit 19 indicates SSE4 support
- ANDL $1, CX // CX != 0 if support SSE4
- MOVB CX, ret+0(FP)
- RET
diff --git a/vendor/golang.org/x/net/bpf/instructions.go b/vendor/golang.org/x/net/bpf/instructions.go
index f9dc0e8ee..3b4fd0891 100644
--- a/vendor/golang.org/x/net/bpf/instructions.go
+++ b/vendor/golang.org/x/net/bpf/instructions.go
@@ -198,7 +198,7 @@ func (a LoadConstant) Assemble() (RawInstruction, error) {
return assembleLoad(a.Dst, 4, opAddrModeImmediate, a.Val)
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadConstant) String() string {
switch a.Dst {
case RegA:
@@ -224,7 +224,7 @@ func (a LoadScratch) Assemble() (RawInstruction, error) {
return assembleLoad(a.Dst, 4, opAddrModeScratch, uint32(a.N))
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadScratch) String() string {
switch a.Dst {
case RegA:
@@ -248,7 +248,7 @@ func (a LoadAbsolute) Assemble() (RawInstruction, error) {
return assembleLoad(RegA, a.Size, opAddrModeAbsolute, a.Off)
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadAbsolute) String() string {
switch a.Size {
case 1: // byte
@@ -277,7 +277,7 @@ func (a LoadIndirect) Assemble() (RawInstruction, error) {
return assembleLoad(RegA, a.Size, opAddrModeIndirect, a.Off)
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadIndirect) String() string {
switch a.Size {
case 1: // byte
@@ -306,7 +306,7 @@ func (a LoadMemShift) Assemble() (RawInstruction, error) {
return assembleLoad(RegX, 1, opAddrModeMemShift, a.Off)
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadMemShift) String() string {
return fmt.Sprintf("ldx 4*([%d]&0xf)", a.Off)
}
@@ -325,7 +325,7 @@ func (a LoadExtension) Assemble() (RawInstruction, error) {
return assembleLoad(RegA, 4, opAddrModeAbsolute, uint32(extOffset+a.Num))
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a LoadExtension) String() string {
switch a.Num {
case ExtLen:
@@ -392,7 +392,7 @@ func (a StoreScratch) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a StoreScratch) String() string {
switch a.Src {
case RegA:
@@ -418,7 +418,7 @@ func (a ALUOpConstant) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a ALUOpConstant) String() string {
switch a.Op {
case ALUOpAdd:
@@ -458,7 +458,7 @@ func (a ALUOpX) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a ALUOpX) String() string {
switch a.Op {
case ALUOpAdd:
@@ -496,7 +496,7 @@ func (a NegateA) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a NegateA) String() string {
return fmt.Sprintf("neg")
}
@@ -514,7 +514,7 @@ func (a Jump) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a Jump) String() string {
return fmt.Sprintf("ja %d", a.Skip)
}
@@ -566,7 +566,7 @@ func (a JumpIf) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a JumpIf) String() string {
switch a.Cond {
// K == A
@@ -621,7 +621,7 @@ func (a RetA) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a RetA) String() string {
return fmt.Sprintf("ret a")
}
@@ -639,7 +639,7 @@ func (a RetConstant) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a RetConstant) String() string {
return fmt.Sprintf("ret #%d", a.Val)
}
@@ -654,7 +654,7 @@ func (a TXA) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a TXA) String() string {
return fmt.Sprintf("txa")
}
@@ -669,7 +669,7 @@ func (a TAX) Assemble() (RawInstruction, error) {
}, nil
}
-// String returns the instruction in assembler notation.
+// String returns the the instruction in assembler notation.
func (a TAX) String() string {
return fmt.Sprintf("tax")
}
diff --git a/vendor/golang.org/x/net/html/atom/gen.go b/vendor/golang.org/x/net/html/atom/gen.go
index 56cd84251..cc5dc5dbc 100644
--- a/vendor/golang.org/x/net/html/atom/gen.go
+++ b/vendor/golang.org/x/net/html/atom/gen.go
@@ -665,7 +665,6 @@ var eventHandlers = []string{
// extra are ad-hoc values not covered by any of the lists above.
var extra = []string{
- "acronym",
"align",
"annotation",
"annotation-xml",
diff --git a/vendor/golang.org/x/net/html/atom/table.go b/vendor/golang.org/x/net/html/atom/table.go
index a91bd6475..f74018ece 100644
--- a/vendor/golang.org/x/net/html/atom/table.go
+++ b/vendor/golang.org/x/net/html/atom/table.go
@@ -10,367 +10,366 @@ const (
Accept Atom = 0x1a06
AcceptCharset Atom = 0x1a0e
Accesskey Atom = 0x2c09
- Acronym Atom = 0x6907
- Action Atom = 0x26a06
- Address Atom = 0x6f307
- Align Atom = 0x7005
- Allowfullscreen Atom = 0x2000f
- Allowpaymentrequest Atom = 0x8013
- Allowusermedia Atom = 0x9c0e
- Alt Atom = 0xc703
- Annotation Atom = 0x1c90a
- AnnotationXml Atom = 0x1c90e
- Applet Atom = 0x31106
- Area Atom = 0x34e04
- Article Atom = 0x3f407
- As Atom = 0xd002
- Aside Atom = 0xd805
- Async Atom = 0xd005
- Audio Atom = 0xe605
- Autocomplete Atom = 0x2700c
- Autofocus Atom = 0x10209
- Autoplay Atom = 0x11d08
+ Action Atom = 0x25a06
+ Address Atom = 0x6ed07
+ Align Atom = 0x6d405
+ Allowfullscreen Atom = 0x1f00f
+ Allowpaymentrequest Atom = 0x6913
+ Allowusermedia Atom = 0x850e
+ Alt Atom = 0xb003
+ Annotation Atom = 0x1b90a
+ AnnotationXml Atom = 0x1b90e
+ Applet Atom = 0x30106
+ Area Atom = 0x34a04
+ Article Atom = 0x3f007
+ As Atom = 0xb902
+ Aside Atom = 0xc105
+ Async Atom = 0xb905
+ Audio Atom = 0xcf05
+ Autocomplete Atom = 0x2600c
+ Autofocus Atom = 0xeb09
+ Autoplay Atom = 0x10608
B Atom = 0x101
- Base Atom = 0x12c04
- Basefont Atom = 0x12c08
- Bdi Atom = 0x7903
- Bdo Atom = 0x14b03
- Bgsound Atom = 0x15e07
- Big Atom = 0x17003
- Blink Atom = 0x17305
- Blockquote Atom = 0x1870a
+ Base Atom = 0x11504
+ Basefont Atom = 0x11508
+ Bdi Atom = 0x16103
+ Bdo Atom = 0x13403
+ Bgsound Atom = 0x14707
+ Big Atom = 0x15903
+ Blink Atom = 0x15c05
+ Blockquote Atom = 0x1680a
Body Atom = 0x2804
Br Atom = 0x202
- Button Atom = 0x19106
- Canvas Atom = 0xd406
- Caption Atom = 0x22907
- Center Atom = 0x21806
- Challenge Atom = 0x29309
+ Button Atom = 0x17206
+ Canvas Atom = 0xbd06
+ Caption Atom = 0x21907
+ Center Atom = 0x20806
+ Challenge Atom = 0x28309
Charset Atom = 0x2107
- Checked Atom = 0x47107
- Cite Atom = 0x55c04
- Class Atom = 0x5bd05
- Code Atom = 0x1a004
- Col Atom = 0x1a703
- Colgroup Atom = 0x1a708
- Color Atom = 0x1bf05
- Cols Atom = 0x1c404
- Colspan Atom = 0x1c407
- Command Atom = 0x1d707
- Content Atom = 0x58307
- Contenteditable Atom = 0x5830f
- Contextmenu Atom = 0x3780b
- Controls Atom = 0x1de08
- Coords Atom = 0x1ea06
- Crossorigin Atom = 0x1f30b
- Data Atom = 0x49d04
- Datalist Atom = 0x49d08
- Datetime Atom = 0x2b008
- Dd Atom = 0x2cf02
- Default Atom = 0xdb07
- Defer Atom = 0x1a205
- Del Atom = 0x44a03
- Desc Atom = 0x55904
+ Checked Atom = 0x46d07
+ Cite Atom = 0x55804
+ Class Atom = 0x5b905
+ Code Atom = 0x19004
+ Col Atom = 0x19703
+ Colgroup Atom = 0x19708
+ Color Atom = 0x1af05
+ Cols Atom = 0x1b404
+ Colspan Atom = 0x1b407
+ Command Atom = 0x1c707
+ Content Atom = 0x57f07
+ Contenteditable Atom = 0x57f0f
+ Contextmenu Atom = 0x3740b
+ Controls Atom = 0x1ce08
+ Coords Atom = 0x1da06
+ Crossorigin Atom = 0x1e30b
+ Data Atom = 0x49904
+ Datalist Atom = 0x49908
+ Datetime Atom = 0x2a008
+ Dd Atom = 0x2bf02
+ Default Atom = 0xc407
+ Defer Atom = 0x19205
+ Del Atom = 0x44603
+ Desc Atom = 0x55504
Details Atom = 0x4607
Dfn Atom = 0x5f03
- Dialog Atom = 0x7a06
- Dir Atom = 0xba03
- Dirname Atom = 0xba07
- Disabled Atom = 0x16408
- Div Atom = 0x16b03
- Dl Atom = 0x5e602
- Download Atom = 0x45b08
- Draggable Atom = 0x17a09
- Dropzone Atom = 0x3fd08
- Dt Atom = 0x64b02
+ Dialog Atom = 0x16206
+ Dir Atom = 0xa303
+ Dirname Atom = 0xa307
+ Disabled Atom = 0x14d08
+ Div Atom = 0x15403
+ Dl Atom = 0x5e202
+ Download Atom = 0x45708
+ Draggable Atom = 0x18309
+ Dropzone Atom = 0x3f908
+ Dt Atom = 0x64702
Em Atom = 0x4202
Embed Atom = 0x4205
- Enctype Atom = 0x28507
- Face Atom = 0x21604
- Fieldset Atom = 0x21e08
- Figcaption Atom = 0x2260a
- Figure Atom = 0x24006
- Font Atom = 0x13004
- Footer Atom = 0xca06
- For Atom = 0x24c03
- ForeignObject Atom = 0x24c0d
- Foreignobject Atom = 0x2590d
- Form Atom = 0x26604
- Formaction Atom = 0x2660a
- Formenctype Atom = 0x2810b
- Formmethod Atom = 0x29c0a
- Formnovalidate Atom = 0x2a60e
- Formtarget Atom = 0x2b80a
+ Enctype Atom = 0x27507
+ Face Atom = 0x20604
+ Fieldset Atom = 0x20e08
+ Figcaption Atom = 0x2160a
+ Figure Atom = 0x23006
+ Font Atom = 0x11904
+ Footer Atom = 0xb306
+ For Atom = 0x23c03
+ ForeignObject Atom = 0x23c0d
+ Foreignobject Atom = 0x2490d
+ Form Atom = 0x25604
+ Formaction Atom = 0x2560a
+ Formenctype Atom = 0x2710b
+ Formmethod Atom = 0x28c0a
+ Formnovalidate Atom = 0x2960e
+ Formtarget Atom = 0x2a80a
Frame Atom = 0x5705
Frameset Atom = 0x5708
- H1 Atom = 0x15c02
- H2 Atom = 0x2d602
- H3 Atom = 0x30502
- H4 Atom = 0x33d02
- H5 Atom = 0x34702
- H6 Atom = 0x64d02
- Head Atom = 0x32904
- Header Atom = 0x32906
- Headers Atom = 0x32907
- Height Atom = 0x14306
- Hgroup Atom = 0x2c206
- Hidden Atom = 0x2cd06
- High Atom = 0x2d304
- Hr Atom = 0x15702
- Href Atom = 0x2d804
- Hreflang Atom = 0x2d808
- Html Atom = 0x14704
- HttpEquiv Atom = 0x2e00a
+ H1 Atom = 0x14502
+ H2 Atom = 0x2c602
+ H3 Atom = 0x2f502
+ H4 Atom = 0x33902
+ H5 Atom = 0x34302
+ H6 Atom = 0x64902
+ Head Atom = 0x32504
+ Header Atom = 0x32506
+ Headers Atom = 0x32507
+ Height Atom = 0x12c06
+ Hgroup Atom = 0x2b206
+ Hidden Atom = 0x2bd06
+ High Atom = 0x2c304
+ Hr Atom = 0x14002
+ Href Atom = 0x2c804
+ Hreflang Atom = 0x2c808
+ Html Atom = 0x13004
+ HttpEquiv Atom = 0x2d00a
I Atom = 0x601
- Icon Atom = 0x58204
- Id Atom = 0xda02
- Iframe Atom = 0x2f406
- Image Atom = 0x2fa05
- Img Atom = 0x2ff03
- Input Atom = 0x44305
- Inputmode Atom = 0x44309
- Ins Atom = 0x1fc03
- Integrity Atom = 0x23709
- Is Atom = 0x16502
- Isindex Atom = 0x30707
- Ismap Atom = 0x30e05
- Itemid Atom = 0x38306
- Itemprop Atom = 0x55d08
- Itemref Atom = 0x3c507
- Itemscope Atom = 0x67109
- Itemtype Atom = 0x31708
- Kbd Atom = 0x7803
+ Icon Atom = 0x57e04
+ Id Atom = 0xc302
+ Iframe Atom = 0x2e406
+ Image Atom = 0x2ea05
+ Img Atom = 0x2ef03
+ Input Atom = 0x43f05
+ Inputmode Atom = 0x43f09
+ Ins Atom = 0x1ec03
+ Integrity Atom = 0x22709
+ Is Atom = 0x14e02
+ Isindex Atom = 0x2f707
+ Ismap Atom = 0x2fe05
+ Itemid Atom = 0x37f06
+ Itemprop Atom = 0x55908
+ Itemref Atom = 0x3c107
+ Itemscope Atom = 0x66d09
+ Itemtype Atom = 0x30708
+ Kbd Atom = 0x16003
Keygen Atom = 0x3206
- Keytype Atom = 0x9507
- Kind Atom = 0x17704
- Label Atom = 0xf105
- Lang Atom = 0x2dc04
- Legend Atom = 0x18106
- Li Atom = 0x7102
- Link Atom = 0x17404
- List Atom = 0x4a104
- Listing Atom = 0x4a107
- Loop Atom = 0xf504
- Low Atom = 0x8203
+ Keytype Atom = 0x7e07
+ Kind Atom = 0x18004
+ Label Atom = 0xda05
+ Lang Atom = 0x2cc04
+ Legend Atom = 0x18a06
+ Li Atom = 0x11102
+ Link Atom = 0x15d04
+ List Atom = 0x49d04
+ Listing Atom = 0x49d07
+ Loop Atom = 0xde04
+ Low Atom = 0x6b03
Main Atom = 0x1004
- Malignmark Atom = 0x6f0a
- Manifest Atom = 0x6d708
- Map Atom = 0x31003
- Mark Atom = 0x7504
- Marquee Atom = 0x31f07
- Math Atom = 0x32604
- Max Atom = 0x33503
- Maxlength Atom = 0x33509
- Media Atom = 0xa505
- Mediagroup Atom = 0xa50a
- Menu Atom = 0x37f04
- Menuitem Atom = 0x37f08
- Meta Atom = 0x4b004
- Meter Atom = 0xbf05
- Method Atom = 0x2a006
- Mglyph Atom = 0x30006
- Mi Atom = 0x33f02
- Min Atom = 0x33f03
- Minlength Atom = 0x33f09
- Mn Atom = 0x2a902
+ Malignmark Atom = 0x6d30a
+ Manifest Atom = 0x30f08
+ Map Atom = 0x30003
+ Mark Atom = 0x6d904
+ Marquee Atom = 0x31b07
+ Math Atom = 0x32204
+ Max Atom = 0x33103
+ Maxlength Atom = 0x33109
+ Media Atom = 0x8e05
+ Mediagroup Atom = 0x8e0a
+ Menu Atom = 0x37b04
+ Menuitem Atom = 0x37b08
+ Meta Atom = 0x4ac04
+ Meter Atom = 0xa805
+ Method Atom = 0x29006
+ Mglyph Atom = 0x2f006
+ Mi Atom = 0x33b02
+ Min Atom = 0x33b03
+ Minlength Atom = 0x33b09
+ Mn Atom = 0x29902
Mo Atom = 0x6302
- Ms Atom = 0x67402
- Mtext Atom = 0x34905
- Multiple Atom = 0x35708
- Muted Atom = 0x35f05
- Name Atom = 0xbd04
+ Ms Atom = 0x67002
+ Mtext Atom = 0x34505
+ Multiple Atom = 0x35308
+ Muted Atom = 0x35b05
+ Name Atom = 0xa604
Nav Atom = 0x1303
Nobr Atom = 0x3704
Noembed Atom = 0x4007
Noframes Atom = 0x5508
Nomodule Atom = 0x6108
- Nonce Atom = 0x56605
- Noscript Atom = 0x20e08
- Novalidate Atom = 0x2aa0a
- Object Atom = 0x26006
- Ol Atom = 0x11802
- Onabort Atom = 0x19507
- Onafterprint Atom = 0x22e0c
- Onautocomplete Atom = 0x26e0e
- Onautocompleteerror Atom = 0x26e13
- Onauxclick Atom = 0x61f0a
- Onbeforeprint Atom = 0x69e0d
- Onbeforeunload Atom = 0x6e70e
- Onblur Atom = 0x5c606
- Oncancel Atom = 0xea08
- Oncanplay Atom = 0x14d09
- Oncanplaythrough Atom = 0x14d10
- Onchange Atom = 0x41308
- Onclick Atom = 0x2ed07
- Onclose Atom = 0x36407
- Oncontextmenu Atom = 0x3760d
- Oncopy Atom = 0x38906
- Oncuechange Atom = 0x38f0b
- Oncut Atom = 0x39a05
- Ondblclick Atom = 0x39f0a
- Ondrag Atom = 0x3a906
- Ondragend Atom = 0x3a909
- Ondragenter Atom = 0x3b20b
- Ondragexit Atom = 0x3bd0a
- Ondragleave Atom = 0x3d70b
- Ondragover Atom = 0x3e20a
- Ondragstart Atom = 0x3ec0b
- Ondrop Atom = 0x3fb06
- Ondurationchange Atom = 0x40b10
- Onemptied Atom = 0x40209
- Onended Atom = 0x41b07
- Onerror Atom = 0x42207
- Onfocus Atom = 0x42907
- Onhashchange Atom = 0x4350c
- Oninput Atom = 0x44107
- Oninvalid Atom = 0x44d09
- Onkeydown Atom = 0x45609
- Onkeypress Atom = 0x4630a
- Onkeyup Atom = 0x47807
- Onlanguagechange Atom = 0x48510
- Onload Atom = 0x49506
- Onloadeddata Atom = 0x4950c
- Onloadedmetadata Atom = 0x4a810
- Onloadend Atom = 0x4be09
- Onloadstart Atom = 0x4c70b
- Onmessage Atom = 0x4d209
- Onmessageerror Atom = 0x4d20e
- Onmousedown Atom = 0x4e00b
- Onmouseenter Atom = 0x4eb0c
- Onmouseleave Atom = 0x4f70c
- Onmousemove Atom = 0x5030b
- Onmouseout Atom = 0x50e0a
- Onmouseover Atom = 0x51b0b
- Onmouseup Atom = 0x52609
- Onmousewheel Atom = 0x5340c
- Onoffline Atom = 0x54009
- Ononline Atom = 0x54908
- Onpagehide Atom = 0x5510a
- Onpageshow Atom = 0x56b0a
- Onpaste Atom = 0x57707
- Onpause Atom = 0x59207
- Onplay Atom = 0x59c06
- Onplaying Atom = 0x59c09
- Onpopstate Atom = 0x5a50a
- Onprogress Atom = 0x5af0a
- Onratechange Atom = 0x5cc0c
- Onrejectionhandled Atom = 0x5d812
- Onreset Atom = 0x5ea07
- Onresize Atom = 0x5f108
- Onscroll Atom = 0x60008
- Onsecuritypolicyviolation Atom = 0x60819
- Onseeked Atom = 0x62908
- Onseeking Atom = 0x63109
- Onselect Atom = 0x63a08
- Onshow Atom = 0x64406
- Onsort Atom = 0x64f06
- Onstalled Atom = 0x65909
- Onstorage Atom = 0x66209
- Onsubmit Atom = 0x66b08
- Onsuspend Atom = 0x67b09
- Ontimeupdate Atom = 0x1310c
- Ontoggle Atom = 0x68408
- Onunhandledrejection Atom = 0x68c14
- Onunload Atom = 0x6ab08
- Onvolumechange Atom = 0x6b30e
- Onwaiting Atom = 0x6c109
- Onwheel Atom = 0x6ca07
- Open Atom = 0x56304
- Optgroup Atom = 0xf708
- Optimum Atom = 0x6d107
- Option Atom = 0x6e306
- Output Atom = 0x51506
+ Nonce Atom = 0x56205
+ Noscript Atom = 0x1fe08
+ Novalidate Atom = 0x29a0a
+ Object Atom = 0x25006
+ Ol Atom = 0x10102
+ Onabort Atom = 0x17607
+ Onafterprint Atom = 0x21e0c
+ Onautocomplete Atom = 0x25e0e
+ Onautocompleteerror Atom = 0x25e13
+ Onauxclick Atom = 0x61b0a
+ Onbeforeprint Atom = 0x69a0d
+ Onbeforeunload Atom = 0x6e10e
+ Onblur Atom = 0x5c206
+ Oncancel Atom = 0xd308
+ Oncanplay Atom = 0x13609
+ Oncanplaythrough Atom = 0x13610
+ Onchange Atom = 0x40f08
+ Onclick Atom = 0x2dd07
+ Onclose Atom = 0x36007
+ Oncontextmenu Atom = 0x3720d
+ Oncopy Atom = 0x38506
+ Oncuechange Atom = 0x38b0b
+ Oncut Atom = 0x39605
+ Ondblclick Atom = 0x39b0a
+ Ondrag Atom = 0x3a506
+ Ondragend Atom = 0x3a509
+ Ondragenter Atom = 0x3ae0b
+ Ondragexit Atom = 0x3b90a
+ Ondragleave Atom = 0x3d30b
+ Ondragover Atom = 0x3de0a
+ Ondragstart Atom = 0x3e80b
+ Ondrop Atom = 0x3f706
+ Ondurationchange Atom = 0x40710
+ Onemptied Atom = 0x3fe09
+ Onended Atom = 0x41707
+ Onerror Atom = 0x41e07
+ Onfocus Atom = 0x42507
+ Onhashchange Atom = 0x4310c
+ Oninput Atom = 0x43d07
+ Oninvalid Atom = 0x44909
+ Onkeydown Atom = 0x45209
+ Onkeypress Atom = 0x45f0a
+ Onkeyup Atom = 0x47407
+ Onlanguagechange Atom = 0x48110
+ Onload Atom = 0x49106
+ Onloadeddata Atom = 0x4910c
+ Onloadedmetadata Atom = 0x4a410
+ Onloadend Atom = 0x4ba09
+ Onloadstart Atom = 0x4c30b
+ Onmessage Atom = 0x4ce09
+ Onmessageerror Atom = 0x4ce0e
+ Onmousedown Atom = 0x4dc0b
+ Onmouseenter Atom = 0x4e70c
+ Onmouseleave Atom = 0x4f30c
+ Onmousemove Atom = 0x4ff0b
+ Onmouseout Atom = 0x50a0a
+ Onmouseover Atom = 0x5170b
+ Onmouseup Atom = 0x52209
+ Onmousewheel Atom = 0x5300c
+ Onoffline Atom = 0x53c09
+ Ononline Atom = 0x54508
+ Onpagehide Atom = 0x54d0a
+ Onpageshow Atom = 0x5670a
+ Onpaste Atom = 0x57307
+ Onpause Atom = 0x58e07
+ Onplay Atom = 0x59806
+ Onplaying Atom = 0x59809
+ Onpopstate Atom = 0x5a10a
+ Onprogress Atom = 0x5ab0a
+ Onratechange Atom = 0x5c80c
+ Onrejectionhandled Atom = 0x5d412
+ Onreset Atom = 0x5e607
+ Onresize Atom = 0x5ed08
+ Onscroll Atom = 0x5fc08
+ Onsecuritypolicyviolation Atom = 0x60419
+ Onseeked Atom = 0x62508
+ Onseeking Atom = 0x62d09
+ Onselect Atom = 0x63608
+ Onshow Atom = 0x64006
+ Onsort Atom = 0x64b06
+ Onstalled Atom = 0x65509
+ Onstorage Atom = 0x65e09
+ Onsubmit Atom = 0x66708
+ Onsuspend Atom = 0x67709
+ Ontimeupdate Atom = 0x11a0c
+ Ontoggle Atom = 0x68008
+ Onunhandledrejection Atom = 0x68814
+ Onunload Atom = 0x6a708
+ Onvolumechange Atom = 0x6af0e
+ Onwaiting Atom = 0x6bd09
+ Onwheel Atom = 0x6c607
+ Open Atom = 0x55f04
+ Optgroup Atom = 0xe008
+ Optimum Atom = 0x6cd07
+ Option Atom = 0x6dd06
+ Output Atom = 0x51106
P Atom = 0xc01
Param Atom = 0xc05
Pattern Atom = 0x4f07
- Picture Atom = 0xae07
- Ping Atom = 0xfe04
- Placeholder Atom = 0x1120b
- Plaintext Atom = 0x1ae09
- Playsinline Atom = 0x1210b
- Poster Atom = 0x2c706
- Pre Atom = 0x46803
- Preload Atom = 0x47e07
- Progress Atom = 0x5b108
- Prompt Atom = 0x52e06
- Public Atom = 0x57e06
- Q Atom = 0x8e01
+ Picture Atom = 0x9707
+ Ping Atom = 0xe704
+ Placeholder Atom = 0xfb0b
+ Plaintext Atom = 0x19e09
+ Playsinline Atom = 0x10a0b
+ Poster Atom = 0x2b706
+ Pre Atom = 0x46403
+ Preload Atom = 0x47a07
+ Progress Atom = 0x5ad08
+ Prompt Atom = 0x52a06
+ Public Atom = 0x57a06
+ Q Atom = 0x7701
Radiogroup Atom = 0x30a
- Readonly Atom = 0x34f08
- Referrerpolicy Atom = 0x3c90e
- Rel Atom = 0x47f03
- Required Atom = 0x24408
- Reversed Atom = 0xb308
+ Readonly Atom = 0x34b08
+ Referrerpolicy Atom = 0x3c50e
+ Rel Atom = 0x47b03
+ Required Atom = 0x23408
+ Reversed Atom = 0x9c08
Rows Atom = 0x3a04
Rowspan Atom = 0x3a07
- Rp Atom = 0x23402
- Rt Atom = 0x19a02
- Ruby Atom = 0xc304
+ Rp Atom = 0x22402
+ Rt Atom = 0x17b02
+ Ruby Atom = 0xac04
S Atom = 0x2501
Samp Atom = 0x4c04
- Sandbox Atom = 0x10a07
- Scope Atom = 0x67505
- Scoped Atom = 0x67506
- Script Atom = 0x21006
- Seamless Atom = 0x36908
- Section Atom = 0x5c107
- Select Atom = 0x63c06
- Selected Atom = 0x63c08
- Shape Atom = 0x1e505
- Size Atom = 0x5f504
- Sizes Atom = 0x5f505
- Slot Atom = 0x1ef04
- Small Atom = 0x1fe05
- Sortable Atom = 0x65108
- Sorted Atom = 0x32f06
- Source Atom = 0x37006
- Spacer Atom = 0x42f06
+ Sandbox Atom = 0xf307
+ Scope Atom = 0x67105
+ Scoped Atom = 0x67106
+ Script Atom = 0x20006
+ Seamless Atom = 0x36508
+ Section Atom = 0x5bd07
+ Select Atom = 0x63806
+ Selected Atom = 0x63808
+ Shape Atom = 0x1d505
+ Size Atom = 0x5f104
+ Sizes Atom = 0x5f105
+ Slot Atom = 0x1df04
+ Small Atom = 0x1ee05
+ Sortable Atom = 0x64d08
+ Sorted Atom = 0x32b06
+ Source Atom = 0x36c06
+ Spacer Atom = 0x42b06
Span Atom = 0x3d04
- Spellcheck Atom = 0x46c0a
- Src Atom = 0x5b803
- Srcdoc Atom = 0x5b806
- Srclang Atom = 0x5f907
- Srcset Atom = 0x6f906
- Start Atom = 0x3f205
- Step Atom = 0x57b04
- Strike Atom = 0x9106
- Strong Atom = 0x6dd06
- Style Atom = 0x6ff05
- Sub Atom = 0x66d03
- Summary Atom = 0x70407
- Sup Atom = 0x70b03
- Svg Atom = 0x70e03
- System Atom = 0x71106
- Tabindex Atom = 0x4b608
- Table Atom = 0x58d05
- Target Atom = 0x2bc06
+ Spellcheck Atom = 0x4680a
+ Src Atom = 0x5b403
+ Srcdoc Atom = 0x5b406
+ Srclang Atom = 0x5f507
+ Srcset Atom = 0x6f306
+ Start Atom = 0x3ee05
+ Step Atom = 0x57704
+ Strike Atom = 0x7a06
+ Strong Atom = 0x31506
+ Style Atom = 0x6f905
+ Sub Atom = 0x66903
+ Summary Atom = 0x6fe07
+ Sup Atom = 0x70503
+ Svg Atom = 0x70803
+ System Atom = 0x70b06
+ Tabindex Atom = 0x4b208
+ Table Atom = 0x58905
+ Target Atom = 0x2ac06
Tbody Atom = 0x2705
Td Atom = 0x5e02
- Template Atom = 0x71408
- Textarea Atom = 0x34a08
- Tfoot Atom = 0xc905
- Th Atom = 0x15602
- Thead Atom = 0x32805
- Time Atom = 0x13304
- Title Atom = 0xe105
- Tr Atom = 0x8b02
- Track Atom = 0x19b05
- Translate Atom = 0x1b609
+ Template Atom = 0x70e08
+ Textarea Atom = 0x34608
+ Tfoot Atom = 0xb205
+ Th Atom = 0x13f02
+ Thead Atom = 0x32405
+ Time Atom = 0x11c04
+ Title Atom = 0xca05
+ Tr Atom = 0x7402
+ Track Atom = 0x17c05
+ Translate Atom = 0x1a609
Tt Atom = 0x5102
- Type Atom = 0x9804
- Typemustmatch Atom = 0x2880d
+ Type Atom = 0x8104
+ Typemustmatch Atom = 0x2780d
U Atom = 0xb01
Ul Atom = 0x6602
- Updateviacache Atom = 0x1370e
- Usemap Atom = 0x59606
+ Updateviacache Atom = 0x1200e
+ Usemap Atom = 0x59206
Value Atom = 0x1505
- Var Atom = 0x16d03
- Video Atom = 0x2e905
- Wbr Atom = 0x57403
- Width Atom = 0x64905
- Workertype Atom = 0x71c0a
- Wrap Atom = 0x72604
- Xmp Atom = 0x11003
+ Var Atom = 0x15603
+ Video Atom = 0x2d905
+ Wbr Atom = 0x57003
+ Width Atom = 0x64505
+ Workertype Atom = 0x7160a
+ Wrap Atom = 0x72004
+ Xmp Atom = 0xf903
)
const hash0 = 0x81cdf10e
@@ -378,402 +377,401 @@ const hash0 = 0x81cdf10e
const maxAtomLen = 25
var table = [1 << 9]Atom{
- 0x1: 0xa50a, // mediagroup
- 0x2: 0x2dc04, // lang
+ 0x1: 0x8e0a, // mediagroup
+ 0x2: 0x2cc04, // lang
0x4: 0x2c09, // accesskey
0x5: 0x5708, // frameset
- 0x7: 0x63a08, // onselect
- 0x8: 0x71106, // system
- 0xa: 0x64905, // width
- 0xc: 0x2810b, // formenctype
- 0xd: 0x11802, // ol
- 0xe: 0x38f0b, // oncuechange
- 0x10: 0x14b03, // bdo
- 0x11: 0xe605, // audio
- 0x12: 0x17a09, // draggable
- 0x14: 0x2e905, // video
- 0x15: 0x2a902, // mn
- 0x16: 0x37f04, // menu
- 0x17: 0x2c706, // poster
- 0x19: 0xca06, // footer
- 0x1a: 0x2a006, // method
- 0x1b: 0x2b008, // datetime
- 0x1c: 0x19507, // onabort
- 0x1d: 0x1370e, // updateviacache
- 0x1e: 0xd005, // async
- 0x1f: 0x49506, // onload
- 0x21: 0xea08, // oncancel
- 0x22: 0x62908, // onseeked
- 0x23: 0x2fa05, // image
- 0x24: 0x5d812, // onrejectionhandled
- 0x26: 0x17404, // link
- 0x27: 0x51506, // output
- 0x28: 0x32904, // head
- 0x29: 0x4f70c, // onmouseleave
- 0x2a: 0x57707, // onpaste
- 0x2b: 0x59c09, // onplaying
- 0x2c: 0x1c407, // colspan
- 0x2f: 0x1bf05, // color
- 0x30: 0x5f504, // size
- 0x31: 0x2e00a, // http-equiv
+ 0x7: 0x63608, // onselect
+ 0x8: 0x70b06, // system
+ 0xa: 0x64505, // width
+ 0xc: 0x2710b, // formenctype
+ 0xd: 0x10102, // ol
+ 0xe: 0x38b0b, // oncuechange
+ 0x10: 0x13403, // bdo
+ 0x11: 0xcf05, // audio
+ 0x12: 0x18309, // draggable
+ 0x14: 0x2d905, // video
+ 0x15: 0x29902, // mn
+ 0x16: 0x37b04, // menu
+ 0x17: 0x2b706, // poster
+ 0x19: 0xb306, // footer
+ 0x1a: 0x29006, // method
+ 0x1b: 0x2a008, // datetime
+ 0x1c: 0x17607, // onabort
+ 0x1d: 0x1200e, // updateviacache
+ 0x1e: 0xb905, // async
+ 0x1f: 0x49106, // onload
+ 0x21: 0xd308, // oncancel
+ 0x22: 0x62508, // onseeked
+ 0x23: 0x2ea05, // image
+ 0x24: 0x5d412, // onrejectionhandled
+ 0x26: 0x15d04, // link
+ 0x27: 0x51106, // output
+ 0x28: 0x32504, // head
+ 0x29: 0x4f30c, // onmouseleave
+ 0x2a: 0x57307, // onpaste
+ 0x2b: 0x59809, // onplaying
+ 0x2c: 0x1b407, // colspan
+ 0x2f: 0x1af05, // color
+ 0x30: 0x5f104, // size
+ 0x31: 0x2d00a, // http-equiv
0x33: 0x601, // i
- 0x34: 0x5510a, // onpagehide
- 0x35: 0x68c14, // onunhandledrejection
- 0x37: 0x42207, // onerror
- 0x3a: 0x12c08, // basefont
+ 0x34: 0x54d0a, // onpagehide
+ 0x35: 0x68814, // onunhandledrejection
+ 0x37: 0x41e07, // onerror
+ 0x3a: 0x11508, // basefont
0x3f: 0x1303, // nav
- 0x40: 0x17704, // kind
- 0x41: 0x34f08, // readonly
- 0x42: 0x30006, // mglyph
- 0x44: 0x7102, // li
- 0x46: 0x2cd06, // hidden
- 0x47: 0x70e03, // svg
- 0x48: 0x57b04, // step
- 0x49: 0x23709, // integrity
- 0x4a: 0x57e06, // public
- 0x4c: 0x1a703, // col
- 0x4d: 0x1870a, // blockquote
- 0x4e: 0x34702, // h5
- 0x50: 0x5b108, // progress
- 0x51: 0x5f505, // sizes
- 0x52: 0x33d02, // h4
- 0x56: 0x32805, // thead
- 0x57: 0x9507, // keytype
- 0x58: 0x5af0a, // onprogress
- 0x59: 0x44309, // inputmode
- 0x5a: 0x3a909, // ondragend
- 0x5d: 0x39a05, // oncut
- 0x5e: 0x42f06, // spacer
- 0x5f: 0x1a708, // colgroup
- 0x62: 0x16502, // is
- 0x65: 0xd002, // as
- 0x66: 0x54009, // onoffline
- 0x67: 0x32f06, // sorted
- 0x69: 0x48510, // onlanguagechange
- 0x6c: 0x4350c, // onhashchange
- 0x6d: 0xbd04, // name
- 0x6e: 0xc905, // tfoot
- 0x6f: 0x55904, // desc
- 0x70: 0x33503, // max
- 0x72: 0x1ea06, // coords
- 0x73: 0x30502, // h3
- 0x74: 0x6e70e, // onbeforeunload
+ 0x40: 0x18004, // kind
+ 0x41: 0x34b08, // readonly
+ 0x42: 0x2f006, // mglyph
+ 0x44: 0x11102, // li
+ 0x46: 0x2bd06, // hidden
+ 0x47: 0x70803, // svg
+ 0x48: 0x57704, // step
+ 0x49: 0x22709, // integrity
+ 0x4a: 0x57a06, // public
+ 0x4c: 0x19703, // col
+ 0x4d: 0x1680a, // blockquote
+ 0x4e: 0x34302, // h5
+ 0x50: 0x5ad08, // progress
+ 0x51: 0x5f105, // sizes
+ 0x52: 0x33902, // h4
+ 0x56: 0x32405, // thead
+ 0x57: 0x7e07, // keytype
+ 0x58: 0x5ab0a, // onprogress
+ 0x59: 0x43f09, // inputmode
+ 0x5a: 0x3a509, // ondragend
+ 0x5d: 0x39605, // oncut
+ 0x5e: 0x42b06, // spacer
+ 0x5f: 0x19708, // colgroup
+ 0x62: 0x14e02, // is
+ 0x65: 0xb902, // as
+ 0x66: 0x53c09, // onoffline
+ 0x67: 0x32b06, // sorted
+ 0x69: 0x48110, // onlanguagechange
+ 0x6c: 0x4310c, // onhashchange
+ 0x6d: 0xa604, // name
+ 0x6e: 0xb205, // tfoot
+ 0x6f: 0x55504, // desc
+ 0x70: 0x33103, // max
+ 0x72: 0x1da06, // coords
+ 0x73: 0x2f502, // h3
+ 0x74: 0x6e10e, // onbeforeunload
0x75: 0x3a04, // rows
- 0x76: 0x63c06, // select
- 0x77: 0xbf05, // meter
- 0x78: 0x38306, // itemid
- 0x79: 0x5340c, // onmousewheel
- 0x7a: 0x5b806, // srcdoc
- 0x7d: 0x19b05, // track
- 0x7f: 0x31708, // itemtype
+ 0x76: 0x63806, // select
+ 0x77: 0xa805, // meter
+ 0x78: 0x37f06, // itemid
+ 0x79: 0x5300c, // onmousewheel
+ 0x7a: 0x5b406, // srcdoc
+ 0x7d: 0x17c05, // track
+ 0x7f: 0x30708, // itemtype
0x82: 0x6302, // mo
- 0x83: 0x41308, // onchange
- 0x84: 0x32907, // headers
- 0x85: 0x5cc0c, // onratechange
- 0x86: 0x60819, // onsecuritypolicyviolation
- 0x88: 0x49d08, // datalist
- 0x89: 0x4e00b, // onmousedown
- 0x8a: 0x1ef04, // slot
- 0x8b: 0x4a810, // onloadedmetadata
+ 0x83: 0x40f08, // onchange
+ 0x84: 0x32507, // headers
+ 0x85: 0x5c80c, // onratechange
+ 0x86: 0x60419, // onsecuritypolicyviolation
+ 0x88: 0x49908, // datalist
+ 0x89: 0x4dc0b, // onmousedown
+ 0x8a: 0x1df04, // slot
+ 0x8b: 0x4a410, // onloadedmetadata
0x8c: 0x1a06, // accept
- 0x8d: 0x26006, // object
- 0x91: 0x6b30e, // onvolumechange
+ 0x8d: 0x25006, // object
+ 0x91: 0x6af0e, // onvolumechange
0x92: 0x2107, // charset
- 0x93: 0x26e13, // onautocompleteerror
- 0x94: 0x8013, // allowpaymentrequest
+ 0x93: 0x25e13, // onautocompleteerror
+ 0x94: 0x6913, // allowpaymentrequest
0x95: 0x2804, // body
- 0x96: 0xdb07, // default
- 0x97: 0x63c08, // selected
- 0x98: 0x21604, // face
- 0x99: 0x1e505, // shape
- 0x9b: 0x68408, // ontoggle
- 0x9e: 0x64b02, // dt
- 0x9f: 0x7504, // mark
+ 0x96: 0xc407, // default
+ 0x97: 0x63808, // selected
+ 0x98: 0x20604, // face
+ 0x99: 0x1d505, // shape
+ 0x9b: 0x68008, // ontoggle
+ 0x9e: 0x64702, // dt
+ 0x9f: 0x6d904, // mark
0xa1: 0xb01, // u
- 0xa4: 0x6ab08, // onunload
- 0xa5: 0xf504, // loop
- 0xa6: 0x16408, // disabled
- 0xaa: 0x41b07, // onended
- 0xab: 0x6f0a, // malignmark
- 0xad: 0x67b09, // onsuspend
- 0xae: 0x34905, // mtext
- 0xaf: 0x64f06, // onsort
- 0xb0: 0x55d08, // itemprop
- 0xb3: 0x67109, // itemscope
- 0xb4: 0x17305, // blink
- 0xb6: 0x3a906, // ondrag
+ 0xa4: 0x6a708, // onunload
+ 0xa5: 0xde04, // loop
+ 0xa6: 0x14d08, // disabled
+ 0xaa: 0x41707, // onended
+ 0xab: 0x6d30a, // malignmark
+ 0xad: 0x67709, // onsuspend
+ 0xae: 0x34505, // mtext
+ 0xaf: 0x64b06, // onsort
+ 0xb0: 0x55908, // itemprop
+ 0xb3: 0x66d09, // itemscope
+ 0xb4: 0x15c05, // blink
+ 0xb6: 0x3a506, // ondrag
0xb7: 0x6602, // ul
- 0xb8: 0x26604, // form
- 0xb9: 0x10a07, // sandbox
+ 0xb8: 0x25604, // form
+ 0xb9: 0xf307, // sandbox
0xba: 0x5705, // frame
0xbb: 0x1505, // value
- 0xbc: 0x66209, // onstorage
- 0xbf: 0x6907, // acronym
- 0xc0: 0x19a02, // rt
+ 0xbc: 0x65e09, // onstorage
+ 0xc0: 0x17b02, // rt
0xc2: 0x202, // br
- 0xc3: 0x21e08, // fieldset
- 0xc4: 0x2880d, // typemustmatch
+ 0xc3: 0x20e08, // fieldset
+ 0xc4: 0x2780d, // typemustmatch
0xc5: 0x6108, // nomodule
0xc6: 0x4007, // noembed
- 0xc7: 0x69e0d, // onbeforeprint
- 0xc8: 0x19106, // button
- 0xc9: 0x2ed07, // onclick
- 0xca: 0x70407, // summary
- 0xcd: 0xc304, // ruby
- 0xce: 0x5bd05, // class
- 0xcf: 0x3ec0b, // ondragstart
- 0xd0: 0x22907, // caption
- 0xd4: 0x9c0e, // allowusermedia
- 0xd5: 0x4c70b, // onloadstart
- 0xd9: 0x16b03, // div
- 0xda: 0x4a104, // list
- 0xdb: 0x32604, // math
- 0xdc: 0x44305, // input
- 0xdf: 0x3e20a, // ondragover
- 0xe0: 0x2d602, // h2
- 0xe2: 0x1ae09, // plaintext
- 0xe4: 0x4eb0c, // onmouseenter
- 0xe7: 0x47107, // checked
- 0xe8: 0x46803, // pre
- 0xea: 0x35708, // multiple
- 0xeb: 0x7903, // bdi
- 0xec: 0x33509, // maxlength
- 0xed: 0x8e01, // q
- 0xee: 0x61f0a, // onauxclick
- 0xf0: 0x57403, // wbr
- 0xf2: 0x12c04, // base
- 0xf3: 0x6e306, // option
- 0xf5: 0x40b10, // ondurationchange
+ 0xc7: 0x69a0d, // onbeforeprint
+ 0xc8: 0x17206, // button
+ 0xc9: 0x2dd07, // onclick
+ 0xca: 0x6fe07, // summary
+ 0xcd: 0xac04, // ruby
+ 0xce: 0x5b905, // class
+ 0xcf: 0x3e80b, // ondragstart
+ 0xd0: 0x21907, // caption
+ 0xd4: 0x850e, // allowusermedia
+ 0xd5: 0x4c30b, // onloadstart
+ 0xd9: 0x15403, // div
+ 0xda: 0x49d04, // list
+ 0xdb: 0x32204, // math
+ 0xdc: 0x43f05, // input
+ 0xdf: 0x3de0a, // ondragover
+ 0xe0: 0x2c602, // h2
+ 0xe2: 0x19e09, // plaintext
+ 0xe4: 0x4e70c, // onmouseenter
+ 0xe7: 0x46d07, // checked
+ 0xe8: 0x46403, // pre
+ 0xea: 0x35308, // multiple
+ 0xeb: 0x16103, // bdi
+ 0xec: 0x33109, // maxlength
+ 0xed: 0x7701, // q
+ 0xee: 0x61b0a, // onauxclick
+ 0xf0: 0x57003, // wbr
+ 0xf2: 0x11504, // base
+ 0xf3: 0x6dd06, // option
+ 0xf5: 0x40710, // ondurationchange
0xf7: 0x5508, // noframes
- 0xf9: 0x3fd08, // dropzone
- 0xfb: 0x67505, // scope
- 0xfc: 0xb308, // reversed
- 0xfd: 0x3b20b, // ondragenter
- 0xfe: 0x3f205, // start
- 0xff: 0x11003, // xmp
- 0x100: 0x5f907, // srclang
- 0x101: 0x2ff03, // img
+ 0xf9: 0x3f908, // dropzone
+ 0xfb: 0x67105, // scope
+ 0xfc: 0x9c08, // reversed
+ 0xfd: 0x3ae0b, // ondragenter
+ 0xfe: 0x3ee05, // start
+ 0xff: 0xf903, // xmp
+ 0x100: 0x5f507, // srclang
+ 0x101: 0x2ef03, // img
0x104: 0x101, // b
- 0x105: 0x24c03, // for
- 0x106: 0xd805, // aside
- 0x107: 0x44107, // oninput
- 0x108: 0x34e04, // area
- 0x109: 0x29c0a, // formmethod
- 0x10a: 0x72604, // wrap
- 0x10c: 0x23402, // rp
- 0x10d: 0x4630a, // onkeypress
+ 0x105: 0x23c03, // for
+ 0x106: 0xc105, // aside
+ 0x107: 0x43d07, // oninput
+ 0x108: 0x34a04, // area
+ 0x109: 0x28c0a, // formmethod
+ 0x10a: 0x72004, // wrap
+ 0x10c: 0x22402, // rp
+ 0x10d: 0x45f0a, // onkeypress
0x10e: 0x5102, // tt
- 0x110: 0x33f02, // mi
- 0x111: 0x35f05, // muted
- 0x112: 0xc703, // alt
- 0x113: 0x1a004, // code
+ 0x110: 0x33b02, // mi
+ 0x111: 0x35b05, // muted
+ 0x112: 0xb003, // alt
+ 0x113: 0x19004, // code
0x114: 0x4202, // em
- 0x115: 0x3bd0a, // ondragexit
+ 0x115: 0x3b90a, // ondragexit
0x117: 0x3d04, // span
- 0x119: 0x6d708, // manifest
- 0x11a: 0x37f08, // menuitem
- 0x11b: 0x58307, // content
- 0x11d: 0x6c109, // onwaiting
- 0x11f: 0x4be09, // onloadend
- 0x121: 0x3760d, // oncontextmenu
- 0x123: 0x5c606, // onblur
- 0x124: 0x3f407, // article
- 0x125: 0xba03, // dir
- 0x126: 0xfe04, // ping
- 0x127: 0x24408, // required
- 0x128: 0x44d09, // oninvalid
- 0x129: 0x7005, // align
- 0x12b: 0x58204, // icon
- 0x12c: 0x64d02, // h6
- 0x12d: 0x1c404, // cols
- 0x12e: 0x2260a, // figcaption
- 0x12f: 0x45609, // onkeydown
- 0x130: 0x66b08, // onsubmit
- 0x131: 0x14d09, // oncanplay
- 0x132: 0x70b03, // sup
+ 0x119: 0x30f08, // manifest
+ 0x11a: 0x37b08, // menuitem
+ 0x11b: 0x57f07, // content
+ 0x11d: 0x6bd09, // onwaiting
+ 0x11f: 0x4ba09, // onloadend
+ 0x121: 0x3720d, // oncontextmenu
+ 0x123: 0x5c206, // onblur
+ 0x124: 0x3f007, // article
+ 0x125: 0xa303, // dir
+ 0x126: 0xe704, // ping
+ 0x127: 0x23408, // required
+ 0x128: 0x44909, // oninvalid
+ 0x129: 0x6d405, // align
+ 0x12b: 0x57e04, // icon
+ 0x12c: 0x64902, // h6
+ 0x12d: 0x1b404, // cols
+ 0x12e: 0x2160a, // figcaption
+ 0x12f: 0x45209, // onkeydown
+ 0x130: 0x66708, // onsubmit
+ 0x131: 0x13609, // oncanplay
+ 0x132: 0x70503, // sup
0x133: 0xc01, // p
- 0x135: 0x40209, // onemptied
- 0x136: 0x38906, // oncopy
- 0x137: 0x55c04, // cite
- 0x138: 0x39f0a, // ondblclick
- 0x13a: 0x5030b, // onmousemove
- 0x13c: 0x66d03, // sub
- 0x13d: 0x47f03, // rel
- 0x13e: 0xf708, // optgroup
+ 0x135: 0x3fe09, // onemptied
+ 0x136: 0x38506, // oncopy
+ 0x137: 0x55804, // cite
+ 0x138: 0x39b0a, // ondblclick
+ 0x13a: 0x4ff0b, // onmousemove
+ 0x13c: 0x66903, // sub
+ 0x13d: 0x47b03, // rel
+ 0x13e: 0xe008, // optgroup
0x142: 0x3a07, // rowspan
- 0x143: 0x37006, // source
- 0x144: 0x20e08, // noscript
- 0x145: 0x56304, // open
- 0x146: 0x1fc03, // ins
- 0x147: 0x24c0d, // foreignObject
- 0x148: 0x5a50a, // onpopstate
- 0x14a: 0x28507, // enctype
- 0x14b: 0x26e0e, // onautocomplete
- 0x14c: 0x34a08, // textarea
- 0x14e: 0x2700c, // autocomplete
- 0x14f: 0x15702, // hr
- 0x150: 0x1de08, // controls
- 0x151: 0xda02, // id
- 0x153: 0x22e0c, // onafterprint
- 0x155: 0x2590d, // foreignobject
- 0x156: 0x31f07, // marquee
- 0x157: 0x59207, // onpause
- 0x158: 0x5e602, // dl
- 0x159: 0x14306, // height
- 0x15a: 0x33f03, // min
- 0x15b: 0xba07, // dirname
- 0x15c: 0x1b609, // translate
- 0x15d: 0x14704, // html
- 0x15e: 0x33f09, // minlength
- 0x15f: 0x47e07, // preload
- 0x160: 0x71408, // template
- 0x161: 0x3d70b, // ondragleave
- 0x164: 0x5b803, // src
- 0x165: 0x6dd06, // strong
+ 0x143: 0x36c06, // source
+ 0x144: 0x1fe08, // noscript
+ 0x145: 0x55f04, // open
+ 0x146: 0x1ec03, // ins
+ 0x147: 0x23c0d, // foreignObject
+ 0x148: 0x5a10a, // onpopstate
+ 0x14a: 0x27507, // enctype
+ 0x14b: 0x25e0e, // onautocomplete
+ 0x14c: 0x34608, // textarea
+ 0x14e: 0x2600c, // autocomplete
+ 0x14f: 0x14002, // hr
+ 0x150: 0x1ce08, // controls
+ 0x151: 0xc302, // id
+ 0x153: 0x21e0c, // onafterprint
+ 0x155: 0x2490d, // foreignobject
+ 0x156: 0x31b07, // marquee
+ 0x157: 0x58e07, // onpause
+ 0x158: 0x5e202, // dl
+ 0x159: 0x12c06, // height
+ 0x15a: 0x33b03, // min
+ 0x15b: 0xa307, // dirname
+ 0x15c: 0x1a609, // translate
+ 0x15d: 0x13004, // html
+ 0x15e: 0x33b09, // minlength
+ 0x15f: 0x47a07, // preload
+ 0x160: 0x70e08, // template
+ 0x161: 0x3d30b, // ondragleave
+ 0x164: 0x5b403, // src
+ 0x165: 0x31506, // strong
0x167: 0x4c04, // samp
- 0x168: 0x6f307, // address
- 0x169: 0x54908, // ononline
- 0x16b: 0x1120b, // placeholder
- 0x16c: 0x2bc06, // target
- 0x16d: 0x1fe05, // small
- 0x16e: 0x6ca07, // onwheel
- 0x16f: 0x1c90a, // annotation
- 0x170: 0x46c0a, // spellcheck
+ 0x168: 0x6ed07, // address
+ 0x169: 0x54508, // ononline
+ 0x16b: 0xfb0b, // placeholder
+ 0x16c: 0x2ac06, // target
+ 0x16d: 0x1ee05, // small
+ 0x16e: 0x6c607, // onwheel
+ 0x16f: 0x1b90a, // annotation
+ 0x170: 0x4680a, // spellcheck
0x171: 0x4607, // details
- 0x172: 0xd406, // canvas
- 0x173: 0x10209, // autofocus
+ 0x172: 0xbd06, // canvas
+ 0x173: 0xeb09, // autofocus
0x174: 0xc05, // param
- 0x176: 0x45b08, // download
- 0x177: 0x44a03, // del
- 0x178: 0x36407, // onclose
- 0x179: 0x7803, // kbd
- 0x17a: 0x31106, // applet
- 0x17b: 0x2d804, // href
- 0x17c: 0x5f108, // onresize
- 0x17e: 0x4950c, // onloadeddata
- 0x180: 0x8b02, // tr
- 0x181: 0x2b80a, // formtarget
- 0x182: 0xe105, // title
- 0x183: 0x6ff05, // style
- 0x184: 0x9106, // strike
- 0x185: 0x59606, // usemap
- 0x186: 0x2f406, // iframe
+ 0x176: 0x45708, // download
+ 0x177: 0x44603, // del
+ 0x178: 0x36007, // onclose
+ 0x179: 0x16003, // kbd
+ 0x17a: 0x30106, // applet
+ 0x17b: 0x2c804, // href
+ 0x17c: 0x5ed08, // onresize
+ 0x17e: 0x4910c, // onloadeddata
+ 0x180: 0x7402, // tr
+ 0x181: 0x2a80a, // formtarget
+ 0x182: 0xca05, // title
+ 0x183: 0x6f905, // style
+ 0x184: 0x7a06, // strike
+ 0x185: 0x59206, // usemap
+ 0x186: 0x2e406, // iframe
0x187: 0x1004, // main
- 0x189: 0xae07, // picture
- 0x18c: 0x30e05, // ismap
- 0x18e: 0x49d04, // data
- 0x18f: 0xf105, // label
- 0x191: 0x3c90e, // referrerpolicy
- 0x192: 0x15602, // th
- 0x194: 0x52e06, // prompt
- 0x195: 0x5c107, // section
- 0x197: 0x6d107, // optimum
- 0x198: 0x2d304, // high
- 0x199: 0x15c02, // h1
- 0x19a: 0x65909, // onstalled
- 0x19b: 0x16d03, // var
- 0x19c: 0x13304, // time
- 0x19e: 0x67402, // ms
- 0x19f: 0x32906, // header
- 0x1a0: 0x4d209, // onmessage
- 0x1a1: 0x56605, // nonce
- 0x1a2: 0x2660a, // formaction
- 0x1a3: 0x21806, // center
+ 0x189: 0x9707, // picture
+ 0x18c: 0x2fe05, // ismap
+ 0x18e: 0x49904, // data
+ 0x18f: 0xda05, // label
+ 0x191: 0x3c50e, // referrerpolicy
+ 0x192: 0x13f02, // th
+ 0x194: 0x52a06, // prompt
+ 0x195: 0x5bd07, // section
+ 0x197: 0x6cd07, // optimum
+ 0x198: 0x2c304, // high
+ 0x199: 0x14502, // h1
+ 0x19a: 0x65509, // onstalled
+ 0x19b: 0x15603, // var
+ 0x19c: 0x11c04, // time
+ 0x19e: 0x67002, // ms
+ 0x19f: 0x32506, // header
+ 0x1a0: 0x4ce09, // onmessage
+ 0x1a1: 0x56205, // nonce
+ 0x1a2: 0x2560a, // formaction
+ 0x1a3: 0x20806, // center
0x1a4: 0x3704, // nobr
- 0x1a5: 0x58d05, // table
- 0x1a6: 0x4a107, // listing
- 0x1a7: 0x18106, // legend
- 0x1a9: 0x29309, // challenge
- 0x1aa: 0x24006, // figure
- 0x1ab: 0xa505, // media
- 0x1ae: 0x9804, // type
- 0x1af: 0x13004, // font
- 0x1b0: 0x4d20e, // onmessageerror
- 0x1b1: 0x36908, // seamless
+ 0x1a5: 0x58905, // table
+ 0x1a6: 0x49d07, // listing
+ 0x1a7: 0x18a06, // legend
+ 0x1a9: 0x28309, // challenge
+ 0x1aa: 0x23006, // figure
+ 0x1ab: 0x8e05, // media
+ 0x1ae: 0x8104, // type
+ 0x1af: 0x11904, // font
+ 0x1b0: 0x4ce0e, // onmessageerror
+ 0x1b1: 0x36508, // seamless
0x1b2: 0x5f03, // dfn
- 0x1b3: 0x1a205, // defer
- 0x1b4: 0x8203, // low
- 0x1b5: 0x63109, // onseeking
- 0x1b6: 0x51b0b, // onmouseover
- 0x1b7: 0x2aa0a, // novalidate
- 0x1b8: 0x71c0a, // workertype
- 0x1ba: 0x3c507, // itemref
+ 0x1b3: 0x19205, // defer
+ 0x1b4: 0x6b03, // low
+ 0x1b5: 0x62d09, // onseeking
+ 0x1b6: 0x5170b, // onmouseover
+ 0x1b7: 0x29a0a, // novalidate
+ 0x1b8: 0x7160a, // workertype
+ 0x1ba: 0x3c107, // itemref
0x1bd: 0x1, // a
- 0x1be: 0x31003, // map
- 0x1bf: 0x1310c, // ontimeupdate
- 0x1c0: 0x15e07, // bgsound
+ 0x1be: 0x30003, // map
+ 0x1bf: 0x11a0c, // ontimeupdate
+ 0x1c0: 0x14707, // bgsound
0x1c1: 0x3206, // keygen
0x1c2: 0x2705, // tbody
- 0x1c5: 0x64406, // onshow
+ 0x1c5: 0x64006, // onshow
0x1c7: 0x2501, // s
0x1c8: 0x4f07, // pattern
- 0x1cc: 0x14d10, // oncanplaythrough
- 0x1ce: 0x2cf02, // dd
- 0x1cf: 0x6f906, // srcset
- 0x1d0: 0x17003, // big
- 0x1d2: 0x65108, // sortable
- 0x1d3: 0x47807, // onkeyup
- 0x1d5: 0x59c06, // onplay
- 0x1d7: 0x4b004, // meta
- 0x1d8: 0x3fb06, // ondrop
- 0x1da: 0x60008, // onscroll
- 0x1db: 0x1f30b, // crossorigin
- 0x1dc: 0x56b0a, // onpageshow
+ 0x1cc: 0x13610, // oncanplaythrough
+ 0x1ce: 0x2bf02, // dd
+ 0x1cf: 0x6f306, // srcset
+ 0x1d0: 0x15903, // big
+ 0x1d2: 0x64d08, // sortable
+ 0x1d3: 0x47407, // onkeyup
+ 0x1d5: 0x59806, // onplay
+ 0x1d7: 0x4ac04, // meta
+ 0x1d8: 0x3f706, // ondrop
+ 0x1da: 0x5fc08, // onscroll
+ 0x1db: 0x1e30b, // crossorigin
+ 0x1dc: 0x5670a, // onpageshow
0x1dd: 0x4, // abbr
0x1de: 0x5e02, // td
- 0x1df: 0x5830f, // contenteditable
- 0x1e0: 0x26a06, // action
- 0x1e1: 0x1210b, // playsinline
- 0x1e2: 0x42907, // onfocus
- 0x1e3: 0x2d808, // hreflang
- 0x1e5: 0x50e0a, // onmouseout
- 0x1e6: 0x5ea07, // onreset
- 0x1e7: 0x11d08, // autoplay
- 0x1ea: 0x67506, // scoped
+ 0x1df: 0x57f0f, // contenteditable
+ 0x1e0: 0x25a06, // action
+ 0x1e1: 0x10a0b, // playsinline
+ 0x1e2: 0x42507, // onfocus
+ 0x1e3: 0x2c808, // hreflang
+ 0x1e5: 0x50a0a, // onmouseout
+ 0x1e6: 0x5e607, // onreset
+ 0x1e7: 0x10608, // autoplay
+ 0x1ea: 0x67106, // scoped
0x1ec: 0x30a, // radiogroup
- 0x1ee: 0x3780b, // contextmenu
- 0x1ef: 0x52609, // onmouseup
- 0x1f1: 0x2c206, // hgroup
- 0x1f2: 0x2000f, // allowfullscreen
- 0x1f3: 0x4b608, // tabindex
- 0x1f6: 0x30707, // isindex
+ 0x1ee: 0x3740b, // contextmenu
+ 0x1ef: 0x52209, // onmouseup
+ 0x1f1: 0x2b206, // hgroup
+ 0x1f2: 0x1f00f, // allowfullscreen
+ 0x1f3: 0x4b208, // tabindex
+ 0x1f6: 0x2f707, // isindex
0x1f7: 0x1a0e, // accept-charset
- 0x1f8: 0x2a60e, // formnovalidate
- 0x1fb: 0x1c90e, // annotation-xml
+ 0x1f8: 0x2960e, // formnovalidate
+ 0x1fb: 0x1b90e, // annotation-xml
0x1fc: 0x4205, // embed
- 0x1fd: 0x21006, // script
- 0x1fe: 0x7a06, // dialog
- 0x1ff: 0x1d707, // command
+ 0x1fd: 0x20006, // script
+ 0x1fe: 0x16206, // dialog
+ 0x1ff: 0x1c707, // command
}
const atomText = "abbradiogrouparamainavalueaccept-charsetbodyaccesskeygenobro" +
- "wspanoembedetailsampatternoframesetdfnomoduleacronymalignmar" +
- "kbdialogallowpaymentrequestrikeytypeallowusermediagroupictur" +
- "eversedirnameterubyaltfooterasyncanvasidefaultitleaudioncanc" +
- "elabelooptgroupingautofocusandboxmplaceholderautoplaysinline" +
- "basefontimeupdateviacacheightmlbdoncanplaythrough1bgsoundisa" +
- "bledivarbigblinkindraggablegendblockquotebuttonabortrackcode" +
- "fercolgrouplaintextranslatecolorcolspannotation-xmlcommandco" +
- "ntrolshapecoordslotcrossoriginsmallowfullscreenoscriptfacent" +
- "erfieldsetfigcaptionafterprintegrityfigurequiredforeignObjec" +
- "tforeignobjectformactionautocompleteerrorformenctypemustmatc" +
- "hallengeformmethodformnovalidatetimeformtargethgrouposterhid" +
- "denhigh2hreflanghttp-equivideonclickiframeimageimglyph3isind" +
- "exismappletitemtypemarqueematheadersortedmaxlength4minlength" +
- "5mtextareadonlymultiplemutedoncloseamlessourceoncontextmenui" +
- "temidoncopyoncuechangeoncutondblclickondragendondragenterond" +
- "ragexitemreferrerpolicyondragleaveondragoverondragstarticleo" +
- "ndropzonemptiedondurationchangeonendedonerroronfocuspaceronh" +
- "ashchangeoninputmodeloninvalidonkeydownloadonkeypresspellche" +
- "ckedonkeyupreloadonlanguagechangeonloadeddatalistingonloaded" +
- "metadatabindexonloadendonloadstartonmessageerroronmousedowno" +
- "nmouseenteronmouseleaveonmousemoveonmouseoutputonmouseoveron" +
- "mouseupromptonmousewheelonofflineononlineonpagehidescitempro" +
- "penonceonpageshowbronpastepublicontenteditableonpausemaponpl" +
- "ayingonpopstateonprogressrcdoclassectionbluronratechangeonre" +
- "jectionhandledonresetonresizesrclangonscrollonsecuritypolicy" +
- "violationauxclickonseekedonseekingonselectedonshowidth6onsor" +
- "tableonstalledonstorageonsubmitemscopedonsuspendontoggleonun" +
- "handledrejectionbeforeprintonunloadonvolumechangeonwaitingon" +
- "wheeloptimumanifestrongoptionbeforeunloaddressrcsetstylesumm" +
- "arysupsvgsystemplateworkertypewrap"
+ "wspanoembedetailsampatternoframesetdfnomoduleallowpaymentreq" +
+ "uestrikeytypeallowusermediagroupictureversedirnameterubyaltf" +
+ "ooterasyncanvasidefaultitleaudioncancelabelooptgroupingautof" +
+ "ocusandboxmplaceholderautoplaysinlinebasefontimeupdateviacac" +
+ "heightmlbdoncanplaythrough1bgsoundisabledivarbigblinkbdialog" +
+ "blockquotebuttonabortrackindraggablegendcodefercolgrouplaint" +
+ "extranslatecolorcolspannotation-xmlcommandcontrolshapecoords" +
+ "lotcrossoriginsmallowfullscreenoscriptfacenterfieldsetfigcap" +
+ "tionafterprintegrityfigurequiredforeignObjectforeignobjectfo" +
+ "rmactionautocompleteerrorformenctypemustmatchallengeformmeth" +
+ "odformnovalidatetimeformtargethgrouposterhiddenhigh2hreflang" +
+ "http-equivideonclickiframeimageimglyph3isindexismappletitemt" +
+ "ypemanifestrongmarqueematheadersortedmaxlength4minlength5mte" +
+ "xtareadonlymultiplemutedoncloseamlessourceoncontextmenuitemi" +
+ "doncopyoncuechangeoncutondblclickondragendondragenterondrage" +
+ "xitemreferrerpolicyondragleaveondragoverondragstarticleondro" +
+ "pzonemptiedondurationchangeonendedonerroronfocuspaceronhashc" +
+ "hangeoninputmodeloninvalidonkeydownloadonkeypresspellchecked" +
+ "onkeyupreloadonlanguagechangeonloadeddatalistingonloadedmeta" +
+ "databindexonloadendonloadstartonmessageerroronmousedownonmou" +
+ "seenteronmouseleaveonmousemoveonmouseoutputonmouseoveronmous" +
+ "eupromptonmousewheelonofflineononlineonpagehidescitempropeno" +
+ "nceonpageshowbronpastepublicontenteditableonpausemaponplayin" +
+ "gonpopstateonprogressrcdoclassectionbluronratechangeonreject" +
+ "ionhandledonresetonresizesrclangonscrollonsecuritypolicyviol" +
+ "ationauxclickonseekedonseekingonselectedonshowidth6onsortabl" +
+ "eonstalledonstorageonsubmitemscopedonsuspendontoggleonunhand" +
+ "ledrejectionbeforeprintonunloadonvolumechangeonwaitingonwhee" +
+ "loptimumalignmarkoptionbeforeunloaddressrcsetstylesummarysup" +
+ "svgsystemplateworkertypewrap"
diff --git a/vendor/golang.org/x/net/html/const.go b/vendor/golang.org/x/net/html/const.go
index 5eb7c5a8f..b37e62124 100644
--- a/vendor/golang.org/x/net/html/const.go
+++ b/vendor/golang.org/x/net/html/const.go
@@ -4,7 +4,7 @@
package html
-// Section 12.2.4.2 of the HTML5 specification says "The following elements
+// Section 12.2.3.2 of the HTML5 specification says "The following elements
// have varying levels of special parsing rules".
// https://html.spec.whatwg.org/multipage/syntax.html#the-stack-of-open-elements
var isSpecialElementMap = map[string]bool{
diff --git a/vendor/golang.org/x/net/html/foreign.go b/vendor/golang.org/x/net/html/foreign.go
index 01477a963..d3b384409 100644
--- a/vendor/golang.org/x/net/html/foreign.go
+++ b/vendor/golang.org/x/net/html/foreign.go
@@ -67,7 +67,7 @@ func mathMLTextIntegrationPoint(n *Node) bool {
return false
}
-// Section 12.2.6.5.
+// Section 12.2.5.5.
var breakout = map[string]bool{
"b": true,
"big": true,
@@ -115,7 +115,7 @@ var breakout = map[string]bool{
"var": true,
}
-// Section 12.2.6.5.
+// Section 12.2.5.5.
var svgTagNameAdjustments = map[string]string{
"altglyph": "altGlyph",
"altglyphdef": "altGlyphDef",
@@ -155,7 +155,7 @@ var svgTagNameAdjustments = map[string]string{
"textpath": "textPath",
}
-// Section 12.2.6.1
+// Section 12.2.5.1
var mathMLAttributeAdjustments = map[string]string{
"definitionurl": "definitionURL",
}
diff --git a/vendor/golang.org/x/net/html/node.go b/vendor/golang.org/x/net/html/node.go
index 6f136c4ef..26b657aec 100644
--- a/vendor/golang.org/x/net/html/node.go
+++ b/vendor/golang.org/x/net/html/node.go
@@ -21,10 +21,9 @@ const (
scopeMarkerNode
)
-// Section 12.2.4.3 says "The markers are inserted when entering applet,
-// object, marquee, template, td, th, and caption elements, and are used
-// to prevent formatting from "leaking" into applet, object, marquee,
-// template, td, th, and caption elements".
+// Section 12.2.3.3 says "scope markers are inserted when entering applet
+// elements, buttons, object elements, marquees, table cells, and table
+// captions, and are used to prevent formatting from 'leaking'".
var scopeMarker = Node{Type: scopeMarkerNode}
// A Node consists of a NodeType and some Data (tag name for element nodes,
diff --git a/vendor/golang.org/x/net/html/parse.go b/vendor/golang.org/x/net/html/parse.go
index 2a5abddc6..be4b2bf5a 100644
--- a/vendor/golang.org/x/net/html/parse.go
+++ b/vendor/golang.org/x/net/html/parse.go
@@ -25,12 +25,12 @@ type parser struct {
hasSelfClosingToken bool
// doc is the document root element.
doc *Node
- // The stack of open elements (section 12.2.4.2) and active formatting
- // elements (section 12.2.4.3).
+ // The stack of open elements (section 12.2.3.2) and active formatting
+ // elements (section 12.2.3.3).
oe, afe nodeStack
- // Element pointers (section 12.2.4.4).
+ // Element pointers (section 12.2.3.4).
head, form *Node
- // Other parsing state flags (section 12.2.4.5).
+ // Other parsing state flags (section 12.2.3.5).
scripting, framesetOK bool
// im is the current insertion mode.
im insertionMode
@@ -38,7 +38,7 @@ type parser struct {
// or inTableText insertion mode.
originalIM insertionMode
// fosterParenting is whether new elements should be inserted according to
- // the foster parenting rules (section 12.2.6.1).
+ // the foster parenting rules (section 12.2.5.3).
fosterParenting bool
// quirks is whether the parser is operating in "quirks mode."
quirks bool
@@ -56,7 +56,7 @@ func (p *parser) top() *Node {
return p.doc
}
-// Stop tags for use in popUntil. These come from section 12.2.4.2.
+// Stop tags for use in popUntil. These come from section 12.2.3.2.
var (
defaultScopeStopTags = map[string][]a.Atom{
"": {a.Applet, a.Caption, a.Html, a.Table, a.Td, a.Th, a.Marquee, a.Object, a.Template},
@@ -79,7 +79,7 @@ const (
// popUntil pops the stack of open elements at the highest element whose tag
// is in matchTags, provided there is no higher element in the scope's stop
-// tags (as defined in section 12.2.4.2). It returns whether or not there was
+// tags (as defined in section 12.2.3.2). It returns whether or not there was
// such an element. If there was not, popUntil leaves the stack unchanged.
//
// For example, the set of stop tags for table scope is: "html", "table". If
@@ -234,7 +234,7 @@ func (p *parser) shouldFosterParent() bool {
}
// fosterParent adds a child node according to the foster parenting rules.
-// Section 12.2.6.1, "foster parenting".
+// Section 12.2.5.3, "foster parenting".
func (p *parser) fosterParent(n *Node) {
var table, parent, prev *Node
var i int
@@ -304,7 +304,7 @@ func (p *parser) addElement() {
})
}
-// Section 12.2.4.3.
+// Section 12.2.3.3.
func (p *parser) addFormattingElement() {
tagAtom, attr := p.tok.DataAtom, p.tok.Attr
p.addElement()
@@ -351,7 +351,7 @@ findIdenticalElements:
p.afe = append(p.afe, p.top())
}
-// Section 12.2.4.3.
+// Section 12.2.3.3.
func (p *parser) clearActiveFormattingElements() {
for {
n := p.afe.pop()
@@ -361,7 +361,7 @@ func (p *parser) clearActiveFormattingElements() {
}
}
-// Section 12.2.4.3.
+// Section 12.2.3.3.
func (p *parser) reconstructActiveFormattingElements() {
n := p.afe.top()
if n == nil {
@@ -390,12 +390,12 @@ func (p *parser) reconstructActiveFormattingElements() {
}
}
-// Section 12.2.5.
+// Section 12.2.4.
func (p *parser) acknowledgeSelfClosingTag() {
p.hasSelfClosingToken = false
}
-// An insertion mode (section 12.2.4.1) is the state transition function from
+// An insertion mode (section 12.2.3.1) is the state transition function from
// a particular state in the HTML5 parser's state machine. It updates the
// parser's fields depending on parser.tok (where ErrorToken means EOF).
// It returns whether the token was consumed.
@@ -403,7 +403,7 @@ type insertionMode func(*parser) bool
// setOriginalIM sets the insertion mode to return to after completing a text or
// inTableText insertion mode.
-// Section 12.2.4.1, "using the rules for".
+// Section 12.2.3.1, "using the rules for".
func (p *parser) setOriginalIM() {
if p.originalIM != nil {
panic("html: bad parser state: originalIM was set twice")
@@ -411,7 +411,7 @@ func (p *parser) setOriginalIM() {
p.originalIM = p.im
}
-// Section 12.2.4.1, "reset the insertion mode".
+// Section 12.2.3.1, "reset the insertion mode".
func (p *parser) resetInsertionMode() {
for i := len(p.oe) - 1; i >= 0; i-- {
n := p.oe[i]
@@ -452,7 +452,7 @@ func (p *parser) resetInsertionMode() {
const whitespace = " \t\r\n\f"
-// Section 12.2.6.4.1.
+// Section 12.2.5.4.1.
func initialIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -479,7 +479,7 @@ func initialIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.2.
+// Section 12.2.5.4.2.
func beforeHTMLIM(p *parser) bool {
switch p.tok.Type {
case DoctypeToken:
@@ -517,7 +517,7 @@ func beforeHTMLIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.3.
+// Section 12.2.5.4.3.
func beforeHeadIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -560,7 +560,7 @@ func beforeHeadIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.4.
+// Section 12.2.5.4.4.
func inHeadIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -622,7 +622,7 @@ func inHeadIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.6.
+// Section 12.2.5.4.6.
func afterHeadIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -697,7 +697,7 @@ func copyAttributes(dst *Node, src Token) {
}
}
-// Section 12.2.6.4.7.
+// Section 12.2.5.4.7.
func inBodyIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -1160,7 +1160,7 @@ func (p *parser) inBodyEndTagFormatting(tagAtom a.Atom) {
}
// inBodyEndTagOther performs the "any other end tag" algorithm for inBodyIM.
-// "Any other end tag" handling from 12.2.6.5 The rules for parsing tokens in foreign content
+// "Any other end tag" handling from 12.2.5.5 The rules for parsing tokens in foreign content
// https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inforeign
func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
for i := len(p.oe) - 1; i >= 0; i-- {
@@ -1174,7 +1174,7 @@ func (p *parser) inBodyEndTagOther(tagAtom a.Atom) {
}
}
-// Section 12.2.6.4.8.
+// Section 12.2.5.4.8.
func textIM(p *parser) bool {
switch p.tok.Type {
case ErrorToken:
@@ -1203,7 +1203,7 @@ func textIM(p *parser) bool {
return p.tok.Type == EndTagToken
}
-// Section 12.2.6.4.9.
+// Section 12.2.5.4.9.
func inTableIM(p *parser) bool {
switch p.tok.Type {
case ErrorToken:
@@ -1309,7 +1309,7 @@ func inTableIM(p *parser) bool {
return inBodyIM(p)
}
-// Section 12.2.6.4.11.
+// Section 12.2.5.4.11.
func inCaptionIM(p *parser) bool {
switch p.tok.Type {
case StartTagToken:
@@ -1355,7 +1355,7 @@ func inCaptionIM(p *parser) bool {
return inBodyIM(p)
}
-// Section 12.2.6.4.12.
+// Section 12.2.5.4.12.
func inColumnGroupIM(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -1408,7 +1408,7 @@ func inColumnGroupIM(p *parser) bool {
return true
}
-// Section 12.2.6.4.13.
+// Section 12.2.5.4.13.
func inTableBodyIM(p *parser) bool {
switch p.tok.Type {
case StartTagToken:
@@ -1460,7 +1460,7 @@ func inTableBodyIM(p *parser) bool {
return inTableIM(p)
}
-// Section 12.2.6.4.14.
+// Section 12.2.5.4.14.
func inRowIM(p *parser) bool {
switch p.tok.Type {
case StartTagToken:
@@ -1511,7 +1511,7 @@ func inRowIM(p *parser) bool {
return inTableIM(p)
}
-// Section 12.2.6.4.15.
+// Section 12.2.5.4.15.
func inCellIM(p *parser) bool {
switch p.tok.Type {
case StartTagToken:
@@ -1560,7 +1560,7 @@ func inCellIM(p *parser) bool {
return inBodyIM(p)
}
-// Section 12.2.6.4.16.
+// Section 12.2.5.4.16.
func inSelectIM(p *parser) bool {
switch p.tok.Type {
case ErrorToken:
@@ -1632,7 +1632,7 @@ func inSelectIM(p *parser) bool {
return true
}
-// Section 12.2.6.4.17.
+// Section 12.2.5.4.17.
func inSelectInTableIM(p *parser) bool {
switch p.tok.Type {
case StartTagToken, EndTagToken:
@@ -1650,7 +1650,7 @@ func inSelectInTableIM(p *parser) bool {
return inSelectIM(p)
}
-// Section 12.2.6.4.19.
+// Section 12.2.5.4.18.
func afterBodyIM(p *parser) bool {
switch p.tok.Type {
case ErrorToken:
@@ -1688,7 +1688,7 @@ func afterBodyIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.20.
+// Section 12.2.5.4.19.
func inFramesetIM(p *parser) bool {
switch p.tok.Type {
case CommentToken:
@@ -1738,7 +1738,7 @@ func inFramesetIM(p *parser) bool {
return true
}
-// Section 12.2.6.4.21.
+// Section 12.2.5.4.20.
func afterFramesetIM(p *parser) bool {
switch p.tok.Type {
case CommentToken:
@@ -1777,7 +1777,7 @@ func afterFramesetIM(p *parser) bool {
return true
}
-// Section 12.2.6.4.22.
+// Section 12.2.5.4.21.
func afterAfterBodyIM(p *parser) bool {
switch p.tok.Type {
case ErrorToken:
@@ -1806,7 +1806,7 @@ func afterAfterBodyIM(p *parser) bool {
return false
}
-// Section 12.2.6.4.23.
+// Section 12.2.5.4.22.
func afterAfterFramesetIM(p *parser) bool {
switch p.tok.Type {
case CommentToken:
@@ -1844,7 +1844,7 @@ func afterAfterFramesetIM(p *parser) bool {
const whitespaceOrNUL = whitespace + "\x00"
-// Section 12.2.6.5
+// Section 12.2.5.5.
func parseForeignContent(p *parser) bool {
switch p.tok.Type {
case TextToken:
@@ -1924,7 +1924,7 @@ func parseForeignContent(p *parser) bool {
return true
}
-// Section 12.2.6.
+// Section 12.2.5.
func (p *parser) inForeignContent() bool {
if len(p.oe) == 0 {
return false
diff --git a/vendor/golang.org/x/net/internal/iana/const.go b/vendor/golang.org/x/net/internal/iana/const.go
index 826633e1b..c9df24d95 100644
--- a/vendor/golang.org/x/net/internal/iana/const.go
+++ b/vendor/golang.org/x/net/internal/iana/const.go
@@ -1,5 +1,5 @@
// go generate gen.go
-// Code generated by the command above; DO NOT EDIT.
+// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).
package iana // import "golang.org/x/net/internal/iana"
@@ -38,7 +38,7 @@ const (
CongestionExperienced = 0x3 // CE (Congestion Experienced)
)
-// Protocol Numbers, Updated: 2017-10-13
+// Protocol Numbers, Updated: 2016-06-22
const (
ProtocolIP = 0 // IPv4 encapsulation, pseudo protocol number
ProtocolHOPOPT = 0 // IPv6 Hop-by-Hop Option
@@ -178,50 +178,3 @@ const (
ProtocolROHC = 142 // Robust Header Compression
ProtocolReserved = 255 // Reserved
)
-
-// Address Family Numbers, Updated: 2016-10-25
-const (
- AddrFamilyIPv4 = 1 // IP (IP version 4)
- AddrFamilyIPv6 = 2 // IP6 (IP version 6)
- AddrFamilyNSAP = 3 // NSAP
- AddrFamilyHDLC = 4 // HDLC (8-bit multidrop)
- AddrFamilyBBN1822 = 5 // BBN 1822
- AddrFamily802 = 6 // 802 (includes all 802 media plus Ethernet "canonical format")
- AddrFamilyE163 = 7 // E.163
- AddrFamilyE164 = 8 // E.164 (SMDS, Frame Relay, ATM)
- AddrFamilyF69 = 9 // F.69 (Telex)
- AddrFamilyX121 = 10 // X.121 (X.25, Frame Relay)
- AddrFamilyIPX = 11 // IPX
- AddrFamilyAppletalk = 12 // Appletalk
- AddrFamilyDecnetIV = 13 // Decnet IV
- AddrFamilyBanyanVines = 14 // Banyan Vines
- AddrFamilyE164withSubaddress = 15 // E.164 with NSAP format subaddress
- AddrFamilyDNS = 16 // DNS (Domain Name System)
- AddrFamilyDistinguishedName = 17 // Distinguished Name
- AddrFamilyASNumber = 18 // AS Number
- AddrFamilyXTPoverIPv4 = 19 // XTP over IP version 4
- AddrFamilyXTPoverIPv6 = 20 // XTP over IP version 6
- AddrFamilyXTPnativemodeXTP = 21 // XTP native mode XTP
- AddrFamilyFibreChannelWorldWidePortName = 22 // Fibre Channel World-Wide Port Name
- AddrFamilyFibreChannelWorldWideNodeName = 23 // Fibre Channel World-Wide Node Name
- AddrFamilyGWID = 24 // GWID
- AddrFamilyL2VPN = 25 // AFI for L2VPN information
- AddrFamilyMPLSTPSectionEndpointID = 26 // MPLS-TP Section Endpoint Identifier
- AddrFamilyMPLSTPLSPEndpointID = 27 // MPLS-TP LSP Endpoint Identifier
- AddrFamilyMPLSTPPseudowireEndpointID = 28 // MPLS-TP Pseudowire Endpoint Identifier
- AddrFamilyMTIPv4 = 29 // MT IP: Multi-Topology IP version 4
- AddrFamilyMTIPv6 = 30 // MT IPv6: Multi-Topology IP version 6
- AddrFamilyEIGRPCommonServiceFamily = 16384 // EIGRP Common Service Family
- AddrFamilyEIGRPIPv4ServiceFamily = 16385 // EIGRP IPv4 Service Family
- AddrFamilyEIGRPIPv6ServiceFamily = 16386 // EIGRP IPv6 Service Family
- AddrFamilyLISPCanonicalAddressFormat = 16387 // LISP Canonical Address Format (LCAF)
- AddrFamilyBGPLS = 16388 // BGP-LS
- AddrFamily48bitMAC = 16389 // 48-bit MAC
- AddrFamily64bitMAC = 16390 // 64-bit MAC
- AddrFamilyOUI = 16391 // OUI
- AddrFamilyMACFinal24bits = 16392 // MAC/24
- AddrFamilyMACFinal40bits = 16393 // MAC/40
- AddrFamilyIPv6Initial64bits = 16394 // IPv6/64
- AddrFamilyRBridgePortID = 16395 // RBridge Port ID
- AddrFamilyTRILLNickname = 16396 // TRILL Nickname
-)
diff --git a/vendor/golang.org/x/net/internal/iana/gen.go b/vendor/golang.org/x/net/internal/iana/gen.go
index 2227e09e8..2a5c310c2 100644
--- a/vendor/golang.org/x/net/internal/iana/gen.go
+++ b/vendor/golang.org/x/net/internal/iana/gen.go
@@ -39,16 +39,12 @@ var registries = []struct {
"https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml",
parseProtocolNumbers,
},
- {
- "http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml",
- parseAddrFamilyNumbers,
- },
}
func main() {
var bb bytes.Buffer
fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
+ fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
fmt.Fprintf(&bb, "// Package iana provides protocol number resources managed by the Internet Assigned Numbers Authority (IANA).\n")
fmt.Fprintf(&bb, `package iana // import "golang.org/x/net/internal/iana"`+"\n\n")
for _, r := range registries {
@@ -295,93 +291,3 @@ func (pn *protocolNumbers) escape() []canonProtocolRecord {
}
return prs
}
-
-func parseAddrFamilyNumbers(w io.Writer, r io.Reader) error {
- dec := xml.NewDecoder(r)
- var afn addrFamilylNumbers
- if err := dec.Decode(&afn); err != nil {
- return err
- }
- afrs := afn.escape()
- fmt.Fprintf(w, "// %s, Updated: %s\n", afn.Title, afn.Updated)
- fmt.Fprintf(w, "const (\n")
- for _, afr := range afrs {
- if afr.Name == "" {
- continue
- }
- fmt.Fprintf(w, "AddrFamily%s = %d", afr.Name, afr.Value)
- fmt.Fprintf(w, "// %s\n", afr.Descr)
- }
- fmt.Fprintf(w, ")\n")
- return nil
-}
-
-type addrFamilylNumbers struct {
- XMLName xml.Name `xml:"registry"`
- Title string `xml:"title"`
- Updated string `xml:"updated"`
- RegTitle string `xml:"registry>title"`
- Note string `xml:"registry>note"`
- Records []struct {
- Value string `xml:"value"`
- Descr string `xml:"description"`
- } `xml:"registry>record"`
-}
-
-type canonAddrFamilyRecord struct {
- Name string
- Descr string
- Value int
-}
-
-func (afn *addrFamilylNumbers) escape() []canonAddrFamilyRecord {
- afrs := make([]canonAddrFamilyRecord, len(afn.Records))
- sr := strings.NewReplacer(
- "IP version 4", "IPv4",
- "IP version 6", "IPv6",
- "Identifier", "ID",
- "-", "",
- "-", "",
- "/", "",
- ".", "",
- " ", "",
- )
- for i, afr := range afn.Records {
- if strings.Contains(afr.Descr, "Unassigned") ||
- strings.Contains(afr.Descr, "Reserved") {
- continue
- }
- afrs[i].Descr = afr.Descr
- s := strings.TrimSpace(afr.Descr)
- switch s {
- case "IP (IP version 4)":
- afrs[i].Name = "IPv4"
- case "IP6 (IP version 6)":
- afrs[i].Name = "IPv6"
- case "AFI for L2VPN information":
- afrs[i].Name = "L2VPN"
- case "E.164 with NSAP format subaddress":
- afrs[i].Name = "E164withSubaddress"
- case "MT IP: Multi-Topology IP version 4":
- afrs[i].Name = "MTIPv4"
- case "MAC/24":
- afrs[i].Name = "MACFinal24bits"
- case "MAC/40":
- afrs[i].Name = "MACFinal40bits"
- case "IPv6/64":
- afrs[i].Name = "IPv6Initial64bits"
- default:
- n := strings.Index(s, "(")
- if n > 0 {
- s = s[:n]
- }
- n = strings.Index(s, ":")
- if n > 0 {
- s = s[:n]
- }
- afrs[i].Name = sr.Replace(s)
- }
- afrs[i].Value, _ = strconv.Atoi(afr.Value)
- }
- return afrs
-}
diff --git a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
index db60491fe..206ea2d11 100644
--- a/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
+++ b/vendor/golang.org/x/net/internal/socket/zsys_netbsd_arm.go
@@ -26,11 +26,6 @@ type msghdr struct {
Flags int32
}
-type mmsghdr struct {
- Hdr msghdr
- Len uint32
-}
-
type cmsghdr struct {
Len uint32
Level int32
@@ -57,7 +52,6 @@ type sockaddrInet6 struct {
const (
sizeofIovec = 0x8
sizeofMsghdr = 0x1c
- sizeofMmsghdr = 0x20
sizeofCmsghdr = 0xc
sizeofSockaddrInet = 0x10
diff --git a/vendor/golang.org/x/net/ipv4/gen.go b/vendor/golang.org/x/net/ipv4/gen.go
index 1bb1737f6..9d490fac9 100644
--- a/vendor/golang.org/x/net/ipv4/gen.go
+++ b/vendor/golang.org/x/net/ipv4/gen.go
@@ -80,7 +80,7 @@ var registries = []struct {
func geniana() error {
var bb bytes.Buffer
fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
+ fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
fmt.Fprintf(&bb, "package ipv4\n\n")
for _, r := range registries {
resp, err := http.Get(r.url)
diff --git a/vendor/golang.org/x/net/ipv4/iana.go b/vendor/golang.org/x/net/ipv4/iana.go
index 4375b4099..be10c9488 100644
--- a/vendor/golang.org/x/net/ipv4/iana.go
+++ b/vendor/golang.org/x/net/ipv4/iana.go
@@ -1,9 +1,9 @@
// go generate gen.go
-// Code generated by the command above; DO NOT EDIT.
+// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package ipv4
-// Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26
+// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19
const (
ICMPTypeEchoReply ICMPType = 0 // Echo Reply
ICMPTypeDestinationUnreachable ICMPType = 3 // Destination Unreachable
@@ -16,11 +16,9 @@ const (
ICMPTypeTimestamp ICMPType = 13 // Timestamp
ICMPTypeTimestampReply ICMPType = 14 // Timestamp Reply
ICMPTypePhoturis ICMPType = 40 // Photuris
- ICMPTypeExtendedEchoRequest ICMPType = 42 // Extended Echo Request
- ICMPTypeExtendedEchoReply ICMPType = 43 // Extended Echo Reply
)
-// Internet Control Message Protocol (ICMP) Parameters, Updated: 2018-02-26
+// Internet Control Message Protocol (ICMP) Parameters, Updated: 2013-04-19
var icmpTypes = map[ICMPType]string{
0: "echo reply",
3: "destination unreachable",
@@ -33,6 +31,4 @@ var icmpTypes = map[ICMPType]string{
13: "timestamp",
14: "timestamp reply",
40: "photuris",
- 42: "extended echo request",
- 43: "extended echo reply",
}
diff --git a/vendor/golang.org/x/net/ipv6/gen.go b/vendor/golang.org/x/net/ipv6/gen.go
index 5885664fb..47b7e9f0a 100644
--- a/vendor/golang.org/x/net/ipv6/gen.go
+++ b/vendor/golang.org/x/net/ipv6/gen.go
@@ -80,7 +80,7 @@ var registries = []struct {
func geniana() error {
var bb bytes.Buffer
fmt.Fprintf(&bb, "// go generate gen.go\n")
- fmt.Fprintf(&bb, "// Code generated by the command above; DO NOT EDIT.\n\n")
+ fmt.Fprintf(&bb, "// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT\n\n")
fmt.Fprintf(&bb, "package ipv6\n\n")
for _, r := range registries {
resp, err := http.Get(r.url)
diff --git a/vendor/golang.org/x/net/ipv6/iana.go b/vendor/golang.org/x/net/ipv6/iana.go
index 32db1aa94..3c6214fb6 100644
--- a/vendor/golang.org/x/net/ipv6/iana.go
+++ b/vendor/golang.org/x/net/ipv6/iana.go
@@ -1,9 +1,9 @@
// go generate gen.go
-// Code generated by the command above; DO NOT EDIT.
+// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
package ipv6
-// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
+// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
const (
ICMPTypeDestinationUnreachable ICMPType = 1 // Destination Unreachable
ICMPTypePacketTooBig ICMPType = 2 // Packet Too Big
@@ -40,11 +40,9 @@ const (
ICMPTypeDuplicateAddressRequest ICMPType = 157 // Duplicate Address Request
ICMPTypeDuplicateAddressConfirmation ICMPType = 158 // Duplicate Address Confirmation
ICMPTypeMPLControl ICMPType = 159 // MPL Control Message
- ICMPTypeExtendedEchoRequest ICMPType = 160 // Extended Echo Request
- ICMPTypeExtendedEchoReply ICMPType = 161 // Extended Echo Reply
)
-// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2018-03-09
+// Internet Control Message Protocol version 6 (ICMPv6) Parameters, Updated: 2015-07-07
var icmpTypes = map[ICMPType]string{
1: "destination unreachable",
2: "packet too big",
@@ -81,6 +79,4 @@ var icmpTypes = map[ICMPType]string{
157: "duplicate address request",
158: "duplicate address confirmation",
159: "mpl control message",
- 160: "extended echo request",
- 161: "extended echo reply",
}
diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go
new file mode 100644
index 000000000..2d1fc12fb
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu.go
@@ -0,0 +1,35 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package cpu implements processor feature detection for
+// various CPU architectures.
+package cpu
+
+// X86 contains the supported CPU features of the
+// current X86/AMD64 platform. If the current platform
+// is not X86/AMD64 then all feature flags are false.
+//
+// X86 is padded to avoid false sharing. Further the HasAVX
+// and HasAVX2 are only set if the OS supports XMM and YMM
+// registers in addition to the CPUID feature bit being set.
+var X86 struct {
+ _ [cacheLineSize]byte
+ HasAES bool // AES hardware implementation (AES NI)
+ HasADX bool // Multi-precision add-carry instruction extensions
+ HasAVX bool // Advanced vector extension
+ HasAVX2 bool // Advanced vector extension 2
+ HasBMI1 bool // Bit manipulation instruction set 1
+ HasBMI2 bool // Bit manipulation instruction set 2
+ HasERMS bool // Enhanced REP for MOVSB and STOSB
+ HasFMA bool // Fused-multiply-add instructions
+ HasOSXSAVE bool // OS supports XSAVE/XRESTOR for saving/restoring XMM registers.
+ HasPCLMULQDQ bool // PCLMULQDQ instruction - most often used for AES-GCM
+ HasPOPCNT bool // Hamming weight instruction POPCNT.
+ HasSSE2 bool // Streaming SIMD extension 2 (always available on amd64)
+ HasSSE3 bool // Streaming SIMD extension 3
+ HasSSSE3 bool // Supplemental streaming SIMD extension 3
+ HasSSE41 bool // Streaming SIMD extension 4 and 4.1
+ HasSSE42 bool // Streaming SIMD extension 4 and 4.2
+ _ [cacheLineSize]byte
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm.go b/vendor/golang.org/x/sys/cpu/cpu_arm.go
new file mode 100644
index 000000000..d93036f75
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm.go
@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+const cacheLineSize = 32
diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
new file mode 100644
index 000000000..1d2ab2902
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go
@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+const cacheLineSize = 64
diff --git a/vendor/golang.org/x/sys/cpu/cpu_mips64x.go b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go
new file mode 100644
index 000000000..6165f1212
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_mips64x.go
@@ -0,0 +1,9 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build mips64 mips64le
+
+package cpu
+
+const cacheLineSize = 32
diff --git a/vendor/golang.org/x/sys/cpu/cpu_mipsx.go b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go
new file mode 100644
index 000000000..1269eee88
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_mipsx.go
@@ -0,0 +1,9 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build mips mipsle
+
+package cpu
+
+const cacheLineSize = 32
diff --git a/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
new file mode 100644
index 000000000..d10759a52
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_ppc64x.go
@@ -0,0 +1,9 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ppc64 ppc64le
+
+package cpu
+
+const cacheLineSize = 128
diff --git a/vendor/golang.org/x/sys/cpu/cpu_s390x.go b/vendor/golang.org/x/sys/cpu/cpu_s390x.go
new file mode 100644
index 000000000..684c4f005
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_s390x.go
@@ -0,0 +1,7 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+const cacheLineSize = 256
diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.go b/vendor/golang.org/x/sys/cpu/cpu_x86.go
new file mode 100644
index 000000000..8842b7cf7
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_x86.go
@@ -0,0 +1,61 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build 386 amd64 amd64p32
+
+package cpu
+
+const cacheLineSize = 64
+
+// cpuid is implemented in cpu_x86.s.
+func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
+
+// xgetbv with ecx = 0 is implemented in cpu_x86.s.
+func xgetbv() (eax, edx uint32)
+
+func init() {
+ maxID, _, _, _ := cpuid(0, 0)
+
+ if maxID < 1 {
+ return
+ }
+
+ _, _, ecx1, edx1 := cpuid(1, 0)
+ X86.HasSSE2 = isSet(26, edx1)
+
+ X86.HasSSE3 = isSet(0, ecx1)
+ X86.HasPCLMULQDQ = isSet(1, ecx1)
+ X86.HasSSSE3 = isSet(9, ecx1)
+ X86.HasFMA = isSet(12, ecx1)
+ X86.HasSSE41 = isSet(19, ecx1)
+ X86.HasSSE42 = isSet(20, ecx1)
+ X86.HasPOPCNT = isSet(23, ecx1)
+ X86.HasAES = isSet(25, ecx1)
+ X86.HasOSXSAVE = isSet(27, ecx1)
+
+ osSupportsAVX := false
+ // For XGETBV, OSXSAVE bit is required and sufficient.
+ if X86.HasOSXSAVE {
+ eax, _ := xgetbv()
+ // Check if XMM and YMM registers have OS support.
+ osSupportsAVX = isSet(1, eax) && isSet(2, eax)
+ }
+
+ X86.HasAVX = isSet(28, ecx1) && osSupportsAVX
+
+ if maxID < 7 {
+ return
+ }
+
+ _, ebx7, _, _ := cpuid(7, 0)
+ X86.HasBMI1 = isSet(3, ebx7)
+ X86.HasAVX2 = isSet(5, ebx7) && osSupportsAVX
+ X86.HasBMI2 = isSet(8, ebx7)
+ X86.HasERMS = isSet(9, ebx7)
+ X86.HasADX = isSet(19, ebx7)
+}
+
+func isSet(bitpos uint, value uint32) bool {
+ return value&(1<<bitpos) != 0
+}
diff --git a/vendor/golang.org/x/sys/cpu/cpu_x86.s b/vendor/golang.org/x/sys/cpu/cpu_x86.s
new file mode 100644
index 000000000..4ff61e00d
--- /dev/null
+++ b/vendor/golang.org/x/sys/cpu/cpu_x86.s
@@ -0,0 +1,26 @@
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build 386 amd64 amd64p32
+
+#include "textflag.h"
+
+// func cpuid(eaxArg, ecxArg uint32) (eax, ebx, ecx, edx uint32)
+TEXT ·cpuid(SB), NOSPLIT, $0-24
+ MOVL eaxArg+0(FP), AX
+ MOVL ecxArg+4(FP), CX
+ CPUID
+ MOVL AX, eax+8(FP)
+ MOVL BX, ebx+12(FP)
+ MOVL CX, ecx+16(FP)
+ MOVL DX, edx+20(FP)
+ RET
+
+// func xgetbv() (eax, edx uint32)
+TEXT ·xgetbv(SB),NOSPLIT,$0-8
+ MOVL $0, CX
+ XGETBV
+ MOVL AX, eax+0(FP)
+ MOVL DX, edx+4(FP)
+ RET
diff --git a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
index d5ed6726c..603dd5728 100644
--- a/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
+++ b/vendor/golang.org/x/sys/unix/asm_dragonfly_amd64.s
@@ -13,17 +13,17 @@
// Just jump to package syscall's implementation for all these functions.
// The runtime may know about them.
-TEXT ·Syscall(SB),NOSPLIT,$0-64
+TEXT ·Syscall(SB),NOSPLIT,$0-56
JMP syscall·Syscall(SB)
-TEXT ·Syscall6(SB),NOSPLIT,$0-88
+TEXT ·Syscall6(SB),NOSPLIT,$0-80
JMP syscall·Syscall6(SB)
-TEXT ·Syscall9(SB),NOSPLIT,$0-112
+TEXT ·Syscall9(SB),NOSPLIT,$0-104
JMP syscall·Syscall9(SB)
-TEXT ·RawSyscall(SB),NOSPLIT,$0-64
+TEXT ·RawSyscall(SB),NOSPLIT,$0-56
JMP syscall·RawSyscall(SB)
-TEXT ·RawSyscall6(SB),NOSPLIT,$0-88
+TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/cap_freebsd.go b/vendor/golang.org/x/sys/unix/cap_freebsd.go
index 83b6bceab..df5204877 100644
--- a/vendor/golang.org/x/sys/unix/cap_freebsd.go
+++ b/vendor/golang.org/x/sys/unix/cap_freebsd.go
@@ -7,7 +7,7 @@
package unix
import (
- errorspkg "errors"
+ "errors"
"fmt"
)
@@ -60,26 +60,26 @@ func CapRightsSet(rights *CapRights, setrights []uint64) error {
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
- return errorspkg.New("bad rights size")
+ return errors.New("bad rights size")
}
for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return errorspkg.New("bad right version")
+ return errors.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return err
}
if i >= n {
- return errorspkg.New("index overflow")
+ return errors.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errorspkg.New("index mismatch")
+ return errors.New("index mismatch")
}
rights.Rights[i] |= right
if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errorspkg.New("index mismatch (after assign)")
+ return errors.New("index mismatch (after assign)")
}
}
@@ -95,26 +95,26 @@ func CapRightsClear(rights *CapRights, clearrights []uint64) error {
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
- return errorspkg.New("bad rights size")
+ return errors.New("bad rights size")
}
for _, right := range clearrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return errorspkg.New("bad right version")
+ return errors.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return err
}
if i >= n {
- return errorspkg.New("index overflow")
+ return errors.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errorspkg.New("index mismatch")
+ return errors.New("index mismatch")
}
rights.Rights[i] &= ^(right & 0x01FFFFFFFFFFFFFF)
if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return errorspkg.New("index mismatch (after assign)")
+ return errors.New("index mismatch (after assign)")
}
}
@@ -130,22 +130,22 @@ func CapRightsIsSet(rights *CapRights, setrights []uint64) (bool, error) {
n := caparsize(rights)
if n < capArSizeMin || n > capArSizeMax {
- return false, errorspkg.New("bad rights size")
+ return false, errors.New("bad rights size")
}
for _, right := range setrights {
if caprver(right) != CAP_RIGHTS_VERSION_00 {
- return false, errorspkg.New("bad right version")
+ return false, errors.New("bad right version")
}
i, err := rightToIndex(right)
if err != nil {
return false, err
}
if i >= n {
- return false, errorspkg.New("index overflow")
+ return false, errors.New("index overflow")
}
if capidxbit(rights.Rights[i]) != capidxbit(right) {
- return false, errorspkg.New("index mismatch")
+ return false, errors.New("index mismatch")
}
if (rights.Rights[i] & right) != right {
return false, nil
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
index 3b5e2c07b..374195bf8 100755
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -171,6 +171,7 @@ struct ltchars {
#include <linux/filter.h>
#include <linux/fs.h>
#include <linux/keyctl.h>
+#include <linux/magic.h>
#include <linux/netlink.h>
#include <linux/perf_event.h>
#include <linux/random.h>
@@ -189,6 +190,7 @@ struct ltchars {
#include <linux/genetlink.h>
#include <linux/stat.h>
#include <linux/watchdog.h>
+#include <linux/hdreg.h>
#include <net/route.h>
#include <asm/termbits.h>
@@ -383,7 +385,8 @@ ccflags="$@"
$2 ~ /^TC[IO](ON|OFF)$/ ||
$2 ~ /^IN_/ ||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
- $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
+ $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|T?PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
+ $2 ~ /^TP_STATUS_/ ||
$2 ~ /^FALLOC_/ ||
$2 == "ICMPV6_FILTER" ||
$2 == "SOMAXCONN" ||
@@ -425,6 +428,7 @@ ccflags="$@"
$2 ~ /^PERF_EVENT_IOC_/ ||
$2 ~ /^SECCOMP_MODE_/ ||
$2 ~ /^SPLICE_/ ||
+ $2 ~ /^[A-Z0-9_]+_MAGIC2?$/ ||
$2 ~ /^(VM|VMADDR)_/ ||
$2 ~ /^IOCTL_VM_SOCKETS_/ ||
$2 ~ /^(TASKSTATS|TS)_/ ||
@@ -436,6 +440,7 @@ ccflags="$@"
$2 ~ /^ATTR_(BIT_MAP_COUNT|(CMN|VOL|FILE)_)/ ||
$2 ~ /^FSOPT_/ ||
$2 ~ /^WDIOC_/ ||
+ $2 ~ /^(HDIO|WIN|SMART)_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ ||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
@@ -505,21 +510,26 @@ echo ')'
enum { A = 'A', Z = 'Z', a = 'a', z = 'z' }; // avoid need for single quotes below
-int errors[] = {
+struct tuple {
+ int num;
+ const char *name;
+};
+
+struct tuple errors[] = {
"
for i in $errors
do
- echo -E ' '$i,
+ echo -E ' {'$i', "'$i'" },'
done
echo -E "
};
-int signals[] = {
+struct tuple signals[] = {
"
for i in $signals
do
- echo -E ' '$i,
+ echo -E ' {'$i', "'$i'" },'
done
# Use -E because on some systems bash builtin interprets \n itself.
@@ -527,9 +537,9 @@ int signals[] = {
};
static int
-intcmp(const void *a, const void *b)
+tuplecmp(const void *a, const void *b)
{
- return *(int*)a - *(int*)b;
+ return ((struct tuple *)a)->num - ((struct tuple *)b)->num;
}
int
@@ -539,26 +549,34 @@ main(void)
char buf[1024], *p;
printf("\n\n// Error table\n");
- printf("var errors = [...]string {\n");
- qsort(errors, nelem(errors), sizeof errors[0], intcmp);
+ printf("var errorList = [...]struct {\n");
+ printf("\tnum syscall.Errno\n");
+ printf("\tname string\n");
+ printf("\tdesc string\n");
+ printf("} {\n");
+ qsort(errors, nelem(errors), sizeof errors[0], tuplecmp);
for(i=0; i<nelem(errors); i++) {
- e = errors[i];
- if(i > 0 && errors[i-1] == e)
+ e = errors[i].num;
+ if(i > 0 && errors[i-1].num == e)
continue;
strcpy(buf, strerror(e));
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
buf[0] += a - A;
- printf("\t%d: \"%s\",\n", e, buf);
+ printf("\t{ %d, \"%s\", \"%s\" },\n", e, errors[i].name, buf);
}
printf("}\n\n");
printf("\n\n// Signal table\n");
- printf("var signals = [...]string {\n");
- qsort(signals, nelem(signals), sizeof signals[0], intcmp);
+ printf("var signalList = [...]struct {\n");
+ printf("\tnum syscall.Signal\n");
+ printf("\tname string\n");
+ printf("\tdesc string\n");
+ printf("} {\n");
+ qsort(signals, nelem(signals), sizeof signals[0], tuplecmp);
for(i=0; i<nelem(signals); i++) {
- e = signals[i];
- if(i > 0 && signals[i-1] == e)
+ e = signals[i].num;
+ if(i > 0 && signals[i-1].num == e)
continue;
strcpy(buf, strsignal(e));
// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
@@ -568,7 +586,7 @@ main(void)
p = strrchr(buf, ":"[0]);
if(p)
*p = '\0';
- printf("\t%d: \"%s\",\n", e, buf);
+ printf("\t{ %d, \"%s\", \"%s\" },\n", e, signals[i].name, buf);
}
printf("}\n\n");
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go
index 7938fe7bf..7e5c22c47 100644
--- a/vendor/golang.org/x/sys/unix/mkpost.go
+++ b/vendor/golang.org/x/sys/unix/mkpost.go
@@ -42,6 +42,10 @@ func main() {
log.Fatal(err)
}
+ // Intentionally export __val fields in Fsid and Sigset_t
+ valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__val(\s+\S+\s+)}`)
+ b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$3}"))
+
// If we have empty Ptrace structs, we should delete them. Only s390x emits
// nonempty Ptrace structs.
ptraceRexexp := regexp.MustCompile(`type Ptrace((Psw|Fpregs|Per) struct {\s*})`)
@@ -70,7 +74,7 @@ func main() {
b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
// Remove padding, hidden, or unused fields
- removeFieldsRegex = regexp.MustCompile(`\bX_\S+`)
+ removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`)
b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
// Remove the first line of warning from cgo
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 006e21f5d..693be791c 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -13,7 +13,7 @@
package unix
import (
- errorspkg "errors"
+ "errors"
"syscall"
"unsafe"
)
@@ -98,7 +98,7 @@ type attrList struct {
func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (attrs [][]byte, err error) {
if len(attrBuf) < 4 {
- return nil, errorspkg.New("attrBuf too small")
+ return nil, errors.New("attrBuf too small")
}
attrList.bitmapCount = attrBitMapCount
@@ -134,12 +134,12 @@ func getAttrList(path string, attrList attrList, attrBuf []byte, options uint) (
for i := uint32(0); int(i) < len(dat); {
header := dat[i:]
if len(header) < 8 {
- return attrs, errorspkg.New("truncated attribute header")
+ return attrs, errors.New("truncated attribute header")
}
datOff := *(*int32)(unsafe.Pointer(&header[0]))
attrLen := *(*uint32)(unsafe.Pointer(&header[4]))
if datOff < 0 || uint32(datOff)+attrLen > uint32(len(dat)) {
- return attrs, errorspkg.New("truncated results; attrBuf too small")
+ return attrs, errors.New("truncated results; attrBuf too small")
}
end := uint32(datOff) + attrLen
attrs = append(attrs, dat[datOff:end])
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index a24ba5fbc..04f38c53e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -944,15 +944,17 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
}
var dummy byte
if len(oob) > 0 {
- var sockType int
- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
- if err != nil {
- return
- }
- // receive at least one normal byte
- if sockType != SOCK_DGRAM && len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ if len(p) == 0 {
+ var sockType int
+ sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
+ if err != nil {
+ return
+ }
+ // receive at least one normal byte
+ if sockType != SOCK_DGRAM {
+ iov.Base = &dummy
+ iov.SetLen(1)
+ }
}
msg.Control = &oob[0]
msg.SetControllen(len(oob))
@@ -996,15 +998,17 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
}
var dummy byte
if len(oob) > 0 {
- var sockType int
- sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
- if err != nil {
- return 0, err
- }
- // send at least one normal byte
- if sockType != SOCK_DGRAM && len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ if len(p) == 0 {
+ var sockType int
+ sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
+ if err != nil {
+ return 0, err
+ }
+ // send at least one normal byte
+ if sockType != SOCK_DGRAM {
+ iov.Base = &dummy
+ iov.SetLen(1)
+ }
}
msg.Control = &oob[0]
msg.SetControllen(len(oob))
@@ -1260,6 +1264,7 @@ func Getpgrp() (pid int) {
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
+//sys PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error)
//sys PivotRoot(newroot string, putold string) (err error) = SYS_PIVOT_ROOT
//sysnb prlimit(pid int, resource int, newlimit *Rlimit, old *Rlimit) (err error) = SYS_PRLIMIT64
//sys Prctl(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uintptr) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
index 53d38a534..d12110632 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
@@ -29,7 +29,15 @@ package unix
//sys Pread(fd int, p []byte, offset int64) (n int, err error) = SYS_PREAD64
//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = SYS_PWRITE64
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
-//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
+
+func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
+ var ts *Timespec
+ if timeout != nil {
+ ts = &Timespec{Sec: timeout.Sec, Nsec: timeout.Usec * 1000}
+ }
+ return Pselect(nfd, r, w, e, ts, nil)
+}
+
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys Setfsgid(gid int) (err error)
//sys Setfsuid(uid int) (err error)
@@ -40,7 +48,12 @@ package unix
//sysnb Setreuid(ruid int, euid int) (err error)
//sys Shutdown(fd int, how int) (err error)
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
-//sys Stat(path string, stat *Stat_t) (err error)
+
+func Stat(path string, stat *Stat_t) (err error) {
+ // Use fstatat, because Android's seccomp policy blocks stat.
+ return Fstatat(AT_FDCWD, path, stat, 0)
+}
+
//sys Statfs(path string, buf *Statfs_t) (err error)
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
//sys Truncate(path string, length int64) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
index 3d5817f66..9e16cc9d1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
@@ -36,7 +36,7 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
//sysnb Setreuid(ruid int, euid int) (err error)
//sys Shutdown(fd int, how int) (err error)
-//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error)
+//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index 387e1cfcf..614fcf049 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -222,6 +222,7 @@ func Uname(uname *Utsname) error {
//sysnb Getppid() (ppid int)
//sys Getpriority(which int, who int) (prio int, err error)
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
+//sysnb Getrtable() (rtable int, err error)
//sysnb Getrusage(who int, rusage *Rusage) (err error)
//sysnb Getsid(pid int) (sid int, err error)
//sysnb Gettimeofday(tv *Timeval) (err error)
@@ -259,6 +260,7 @@ func Uname(uname *Utsname) error {
//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(which int, lim *Rlimit) (err error)
+//sysnb Setrtable(rtable int) (err error)
//sysnb Setsid() (pid int, err error)
//sysnb Settimeofday(tp *Timeval) (err error)
//sysnb Setuid(uid int) (err error)
@@ -307,7 +309,6 @@ func Uname(uname *Utsname) error {
// getlogin
// getresgid
// getresuid
-// getrtable
// getthrid
// ktrace
// lfs_bmapv
@@ -343,7 +344,6 @@ func Uname(uname *Utsname) error {
// semop
// setgroups
// setitimer
-// setrtable
// setsockopt
// shmat
// shmctl
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go
index 262dc520e..b835bad0f 100644
--- a/vendor/golang.org/x/sys/unix/syscall_unix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_unix.go
@@ -9,6 +9,7 @@ package unix
import (
"bytes"
"runtime"
+ "sort"
"sync"
"syscall"
"unsafe"
@@ -51,6 +52,28 @@ func errnoErr(e syscall.Errno) error {
return e
}
+// ErrnoName returns the error name for error number e.
+func ErrnoName(e syscall.Errno) string {
+ i := sort.Search(len(errorList), func(i int) bool {
+ return errorList[i].num >= e
+ })
+ if i < len(errorList) && errorList[i].num == e {
+ return errorList[i].name
+ }
+ return ""
+}
+
+// SignalName returns the signal name for signal number s.
+func SignalName(s syscall.Signal) string {
+ i := sort.Search(len(signalList), func(i int) bool {
+ return signalList[i].num >= s
+ })
+ if i < len(signalList) && signalList[i].num == s {
+ return signalList[i].name
+ }
+ return ""
+}
+
// clen returns the index of the first NULL byte in n or len(n) if n contains no NULL byte.
func clen(n []byte) int {
i := bytes.IndexByte(n, 0)
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
index dcba88424..c5a9b73dc 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_386.go
@@ -1624,146 +1624,154 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "resource busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "device power is off",
- 83: "device error",
- 84: "value too large to be stored in data type",
- 85: "bad executable (or shared library)",
- 86: "bad CPU type in executable",
- 87: "shared library version mismatch",
- 88: "malformed Mach-o file",
- 89: "operation canceled",
- 90: "identifier removed",
- 91: "no message of desired type",
- 92: "illegal byte sequence",
- 93: "attribute not found",
- 94: "bad message",
- 95: "EMULTIHOP (Reserved)",
- 96: "no message available on STREAM",
- 97: "ENOLINK (Reserved)",
- 98: "no STREAM resources",
- 99: "not a STREAM",
- 100: "protocol error",
- 101: "STREAM ioctl timeout",
- 102: "operation not supported on socket",
- 103: "policy not found",
- 104: "state not recoverable",
- 105: "previous owner died",
- 106: "interface output queue is full",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "ENOTSUP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EPWROFF", "device power is off"},
+ {83, "EDEVERR", "device error"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EBADEXEC", "bad executable (or shared library)"},
+ {86, "EBADARCH", "bad CPU type in executable"},
+ {87, "ESHLIBVERS", "shared library version mismatch"},
+ {88, "EBADMACHO", "malformed Mach-o file"},
+ {89, "ECANCELED", "operation canceled"},
+ {90, "EIDRM", "identifier removed"},
+ {91, "ENOMSG", "no message of desired type"},
+ {92, "EILSEQ", "illegal byte sequence"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EBADMSG", "bad message"},
+ {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
+ {96, "ENODATA", "no message available on STREAM"},
+ {97, "ENOLINK", "ENOLINK (Reserved)"},
+ {98, "ENOSR", "no STREAM resources"},
+ {99, "ENOSTR", "not a STREAM"},
+ {100, "EPROTO", "protocol error"},
+ {101, "ETIME", "STREAM ioctl timeout"},
+ {102, "EOPNOTSUPP", "operation not supported on socket"},
+ {103, "ENOPOLICY", "policy not found"},
+ {104, "ENOTRECOVERABLE", "state not recoverable"},
+ {105, "EOWNERDEAD", "previous owner died"},
+ {106, "EQFULL", "interface output queue is full"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
index 1a51c963c..7de222b65 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go
@@ -1624,146 +1624,154 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "resource busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "device power is off",
- 83: "device error",
- 84: "value too large to be stored in data type",
- 85: "bad executable (or shared library)",
- 86: "bad CPU type in executable",
- 87: "shared library version mismatch",
- 88: "malformed Mach-o file",
- 89: "operation canceled",
- 90: "identifier removed",
- 91: "no message of desired type",
- 92: "illegal byte sequence",
- 93: "attribute not found",
- 94: "bad message",
- 95: "EMULTIHOP (Reserved)",
- 96: "no message available on STREAM",
- 97: "ENOLINK (Reserved)",
- 98: "no STREAM resources",
- 99: "not a STREAM",
- 100: "protocol error",
- 101: "STREAM ioctl timeout",
- 102: "operation not supported on socket",
- 103: "policy not found",
- 104: "state not recoverable",
- 105: "previous owner died",
- 106: "interface output queue is full",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "ENOTSUP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EPWROFF", "device power is off"},
+ {83, "EDEVERR", "device error"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EBADEXEC", "bad executable (or shared library)"},
+ {86, "EBADARCH", "bad CPU type in executable"},
+ {87, "ESHLIBVERS", "shared library version mismatch"},
+ {88, "EBADMACHO", "malformed Mach-o file"},
+ {89, "ECANCELED", "operation canceled"},
+ {90, "EIDRM", "identifier removed"},
+ {91, "ENOMSG", "no message of desired type"},
+ {92, "EILSEQ", "illegal byte sequence"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EBADMSG", "bad message"},
+ {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
+ {96, "ENODATA", "no message available on STREAM"},
+ {97, "ENOLINK", "ENOLINK (Reserved)"},
+ {98, "ENOSR", "no STREAM resources"},
+ {99, "ENOSTR", "not a STREAM"},
+ {100, "EPROTO", "protocol error"},
+ {101, "ETIME", "STREAM ioctl timeout"},
+ {102, "EOPNOTSUPP", "operation not supported on socket"},
+ {103, "ENOPOLICY", "policy not found"},
+ {104, "ENOTRECOVERABLE", "state not recoverable"},
+ {105, "EOWNERDEAD", "previous owner died"},
+ {106, "EQFULL", "interface output queue is full"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go
index fa135b17c..33a42e78a 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm.go
@@ -1624,146 +1624,154 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "resource busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "device power is off",
- 83: "device error",
- 84: "value too large to be stored in data type",
- 85: "bad executable (or shared library)",
- 86: "bad CPU type in executable",
- 87: "shared library version mismatch",
- 88: "malformed Mach-o file",
- 89: "operation canceled",
- 90: "identifier removed",
- 91: "no message of desired type",
- 92: "illegal byte sequence",
- 93: "attribute not found",
- 94: "bad message",
- 95: "EMULTIHOP (Reserved)",
- 96: "no message available on STREAM",
- 97: "ENOLINK (Reserved)",
- 98: "no STREAM resources",
- 99: "not a STREAM",
- 100: "protocol error",
- 101: "STREAM ioctl timeout",
- 102: "operation not supported on socket",
- 103: "policy not found",
- 104: "state not recoverable",
- 105: "previous owner died",
- 106: "interface output queue is full",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "ENOTSUP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EPWROFF", "device power is off"},
+ {83, "EDEVERR", "device error"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EBADEXEC", "bad executable (or shared library)"},
+ {86, "EBADARCH", "bad CPU type in executable"},
+ {87, "ESHLIBVERS", "shared library version mismatch"},
+ {88, "EBADMACHO", "malformed Mach-o file"},
+ {89, "ECANCELED", "operation canceled"},
+ {90, "EIDRM", "identifier removed"},
+ {91, "ENOMSG", "no message of desired type"},
+ {92, "EILSEQ", "illegal byte sequence"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EBADMSG", "bad message"},
+ {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
+ {96, "ENODATA", "no message available on STREAM"},
+ {97, "ENOLINK", "ENOLINK (Reserved)"},
+ {98, "ENOSR", "no STREAM resources"},
+ {99, "ENOSTR", "not a STREAM"},
+ {100, "EPROTO", "protocol error"},
+ {101, "ETIME", "STREAM ioctl timeout"},
+ {102, "EOPNOTSUPP", "operation not supported on socket"},
+ {103, "ENOPOLICY", "policy not found"},
+ {104, "ENOTRECOVERABLE", "state not recoverable"},
+ {105, "EOWNERDEAD", "previous owner died"},
+ {106, "EQFULL", "interface output queue is full"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
index 6419c65e1..71805155b 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go
@@ -1624,146 +1624,154 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "resource busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "device power is off",
- 83: "device error",
- 84: "value too large to be stored in data type",
- 85: "bad executable (or shared library)",
- 86: "bad CPU type in executable",
- 87: "shared library version mismatch",
- 88: "malformed Mach-o file",
- 89: "operation canceled",
- 90: "identifier removed",
- 91: "no message of desired type",
- 92: "illegal byte sequence",
- 93: "attribute not found",
- 94: "bad message",
- 95: "EMULTIHOP (Reserved)",
- 96: "no message available on STREAM",
- 97: "ENOLINK (Reserved)",
- 98: "no STREAM resources",
- 99: "not a STREAM",
- 100: "protocol error",
- 101: "STREAM ioctl timeout",
- 102: "operation not supported on socket",
- 103: "policy not found",
- 104: "state not recoverable",
- 105: "previous owner died",
- 106: "interface output queue is full",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "ENOTSUP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EPWROFF", "device power is off"},
+ {83, "EDEVERR", "device error"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EBADEXEC", "bad executable (or shared library)"},
+ {86, "EBADARCH", "bad CPU type in executable"},
+ {87, "ESHLIBVERS", "shared library version mismatch"},
+ {88, "EBADMACHO", "malformed Mach-o file"},
+ {89, "ECANCELED", "operation canceled"},
+ {90, "EIDRM", "identifier removed"},
+ {91, "ENOMSG", "no message of desired type"},
+ {92, "EILSEQ", "illegal byte sequence"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EBADMSG", "bad message"},
+ {95, "EMULTIHOP", "EMULTIHOP (Reserved)"},
+ {96, "ENODATA", "no message available on STREAM"},
+ {97, "ENOLINK", "ENOLINK (Reserved)"},
+ {98, "ENOSR", "no STREAM resources"},
+ {99, "ENOSTR", "not a STREAM"},
+ {100, "EPROTO", "protocol error"},
+ {101, "ETIME", "STREAM ioctl timeout"},
+ {102, "EOPNOTSUPP", "operation not supported on socket"},
+ {103, "ENOPOLICY", "policy not found"},
+ {104, "ENOTRECOVERABLE", "state not recoverable"},
+ {105, "EOWNERDEAD", "previous owner died"},
+ {106, "EQFULL", "interface output queue is full"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
index 474441b80..46a082b6d 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go
@@ -1437,142 +1437,150 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "operation canceled",
- 86: "illegal byte sequence",
- 87: "attribute not found",
- 88: "programming error",
- 89: "bad message",
- 90: "multihop attempted",
- 91: "link has been severed",
- 92: "protocol error",
- 93: "no medium found",
- 94: "unknown error: 94",
- 95: "unknown error: 95",
- 96: "unknown error: 96",
- 97: "unknown error: 97",
- 98: "unknown error: 98",
- 99: "unknown error: 99",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EWOULDBLOCK", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "ECANCELED", "operation canceled"},
+ {86, "EILSEQ", "illegal byte sequence"},
+ {87, "ENOATTR", "attribute not found"},
+ {88, "EDOOFUS", "programming error"},
+ {89, "EBADMSG", "bad message"},
+ {90, "EMULTIHOP", "multihop attempted"},
+ {91, "ENOLINK", "link has been severed"},
+ {92, "EPROTO", "protocol error"},
+ {93, "ENOMEDIUM", "no medium found"},
+ {94, "EUNUSED94", "unknown error: 94"},
+ {95, "EUNUSED95", "unknown error: 95"},
+ {96, "EUNUSED96", "unknown error: 96"},
+ {97, "EUNUSED97", "unknown error: 97"},
+ {98, "EUNUSED98", "unknown error: 98"},
+ {99, "ELAST", "unknown error: 99"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "thread Scheduler",
- 33: "checkPoint",
- 34: "checkPointExit",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "thread Scheduler"},
+ {33, "SIGCKPT", "checkPoint"},
+ {34, "SIGCKPTEXIT", "checkPointExit"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
index a8b05878e..2947dc038 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go
@@ -1619,138 +1619,146 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "operation canceled",
- 86: "illegal byte sequence",
- 87: "attribute not found",
- 88: "programming error",
- 89: "bad message",
- 90: "multihop attempted",
- 91: "link has been severed",
- 92: "protocol error",
- 93: "capabilities insufficient",
- 94: "not permitted in capability mode",
- 95: "state not recoverable",
- 96: "previous owner died",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "ECANCELED", "operation canceled"},
+ {86, "EILSEQ", "illegal byte sequence"},
+ {87, "ENOATTR", "attribute not found"},
+ {88, "EDOOFUS", "programming error"},
+ {89, "EBADMSG", "bad message"},
+ {90, "EMULTIHOP", "multihop attempted"},
+ {91, "ENOLINK", "link has been severed"},
+ {92, "EPROTO", "protocol error"},
+ {93, "ENOTCAPABLE", "capabilities insufficient"},
+ {94, "ECAPMODE", "not permitted in capability mode"},
+ {95, "ENOTRECOVERABLE", "state not recoverable"},
+ {96, "EOWNERDEAD", "previous owner died"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "unknown signal",
- 33: "unknown signal",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "unknown signal"},
+ {33, "SIGLIBRT", "unknown signal"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
index cf5f01260..c600d012d 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go
@@ -1620,138 +1620,146 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "operation canceled",
- 86: "illegal byte sequence",
- 87: "attribute not found",
- 88: "programming error",
- 89: "bad message",
- 90: "multihop attempted",
- 91: "link has been severed",
- 92: "protocol error",
- 93: "capabilities insufficient",
- 94: "not permitted in capability mode",
- 95: "state not recoverable",
- 96: "previous owner died",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "ECANCELED", "operation canceled"},
+ {86, "EILSEQ", "illegal byte sequence"},
+ {87, "ENOATTR", "attribute not found"},
+ {88, "EDOOFUS", "programming error"},
+ {89, "EBADMSG", "bad message"},
+ {90, "EMULTIHOP", "multihop attempted"},
+ {91, "ENOLINK", "link has been severed"},
+ {92, "EPROTO", "protocol error"},
+ {93, "ENOTCAPABLE", "capabilities insufficient"},
+ {94, "ECAPMODE", "not permitted in capability mode"},
+ {95, "ENOTRECOVERABLE", "state not recoverable"},
+ {96, "EOWNERDEAD", "previous owner died"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "unknown signal",
- 33: "unknown signal",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "unknown signal"},
+ {33, "SIGLIBRT", "unknown signal"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
index 9bbb90ad8..e8240d239 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go
@@ -1628,138 +1628,146 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "operation timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "operation canceled",
- 86: "illegal byte sequence",
- 87: "attribute not found",
- 88: "programming error",
- 89: "bad message",
- 90: "multihop attempted",
- 91: "link has been severed",
- 92: "protocol error",
- 93: "capabilities insufficient",
- 94: "not permitted in capability mode",
- 95: "state not recoverable",
- 96: "previous owner died",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "ECANCELED", "operation canceled"},
+ {86, "EILSEQ", "illegal byte sequence"},
+ {87, "ENOATTR", "attribute not found"},
+ {88, "EDOOFUS", "programming error"},
+ {89, "EBADMSG", "bad message"},
+ {90, "EMULTIHOP", "multihop attempted"},
+ {91, "ENOLINK", "link has been severed"},
+ {92, "EPROTO", "protocol error"},
+ {93, "ENOTCAPABLE", "capabilities insufficient"},
+ {94, "ECAPMODE", "not permitted in capability mode"},
+ {95, "ENOTRECOVERABLE", "state not recoverable"},
+ {96, "EOWNERDEAD", "previous owner died"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "suspended (signal)",
- 18: "suspended",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "unknown signal",
- 33: "unknown signal",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "unknown signal"},
+ {33, "SIGLIBRT", "unknown signal"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
index 68de61b8c..9dbd0eff0 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x80041270
BLKBSZSET = 0x40041271
BLKFLSBUF = 0x1261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -462,6 +490,7 @@ const (
FF1 = 0x8000
FFDLY = 0x8000
FLUSHO = 0x1000
+ FP_XSTATE_MAGIC2 = 0x46505845
FS_ENCRYPTION_MODE_AES_128_CBC = 0x5
FS_ENCRYPTION_MODE_AES_128_CTS = 0x6
FS_ENCRYPTION_MODE_AES_256_CBC = 0x3
@@ -482,6 +511,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +573,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +866,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +970,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1038,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1075,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1109,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1118,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1124,9 +1213,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40042406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1323,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1291,6 +1383,11 @@ const (
PTRACE_SYSEMU = 0x1f
PTRACE_SYSEMU_SINGLESTEP = 0x20
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1476,6 +1573,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1560,6 +1659,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1670,6 +1786,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1691,6 +1809,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1872,7 +1991,27 @@ const (
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x400854d5
TUNDETACHFILTER = 0x400854d6
@@ -1900,9 +2039,12 @@ const (
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
@@ -1944,16 +2086,99 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
WORDSIZE = 0x20
WSTOPPED = 0x2
WUNTRACED = 0x2
+ X86_FXSR_MAGIC = 0x0
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2133,171 +2358,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
index a5748ae9e..a9ace38e0 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x80081270
BLKBSZSET = 0x40081271
BLKFLSBUF = 0x1261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -462,6 +490,7 @@ const (
FF1 = 0x8000
FFDLY = 0x8000
FLUSHO = 0x1000
+ FP_XSTATE_MAGIC2 = 0x46505845
FS_ENCRYPTION_MODE_AES_128_CBC = 0x5
FS_ENCRYPTION_MODE_AES_128_CTS = 0x6
FS_ENCRYPTION_MODE_AES_256_CBC = 0x3
@@ -482,6 +511,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +573,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +866,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +970,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1038,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1075,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1109,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1118,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1124,9 +1213,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40082406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1323,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ARCH_PRCTL = 0x1e
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
@@ -1292,6 +1384,11 @@ const (
PTRACE_SYSEMU = 0x1f
PTRACE_SYSEMU_SINGLESTEP = 0x20
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1477,6 +1574,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1561,6 +1660,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1671,6 +1787,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1692,6 +1810,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1873,7 +1992,27 @@ const (
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
TUNDETACHFILTER = 0x401054d6
@@ -1901,9 +2040,12 @@ const (
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
@@ -1945,6 +2087,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1954,7 +2176,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2134,171 +2358,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
index 6d9fc7e94..fe394471b 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x80041270
BLKBSZSET = 0x40041271
BLKFLSBUF = 0x1261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -894,9 +968,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -956,7 +1036,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -991,6 +1073,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1023,6 +1107,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1030,7 +1116,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1123,9 +1211,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40042406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1231,6 +1321,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1299,6 +1390,11 @@ const (
PT_DATA_ADDR = 0x10004
PT_TEXT_ADDR = 0x10000
PT_TEXT_END_ADDR = 0x10008
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1484,6 +1580,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1568,6 +1666,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1678,6 +1793,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1699,6 +1816,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1880,7 +1998,27 @@ const (
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x400854d5
TUNDETACHFILTER = 0x400854d6
@@ -1908,9 +2046,12 @@ const (
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
@@ -1952,6 +2093,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1961,7 +2182,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2141,171 +2364,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
index 0253ba34f..dbe9a5192 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x80081270
BLKBSZSET = 0x40081271
BLKFLSBUF = 0x1261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -447,10 +470,15 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
EXTRA_MAGIC = 0x45585401
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -464,6 +492,7 @@ const (
FF1 = 0x8000
FFDLY = 0x8000
FLUSHO = 0x1000
+ FPSIMD_MAGIC = 0x46508001
FS_ENCRYPTION_MODE_AES_128_CBC = 0x5
FS_ENCRYPTION_MODE_AES_128_CTS = 0x6
FS_ENCRYPTION_MODE_AES_256_CBC = 0x3
@@ -484,6 +513,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -545,6 +575,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -795,12 +868,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -896,9 +971,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -958,7 +1039,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -993,6 +1076,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1025,6 +1110,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1032,7 +1119,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1125,9 +1214,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40082406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1233,6 +1324,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1282,6 +1374,11 @@ const (
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1467,6 +1564,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1551,6 +1650,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1661,6 +1777,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1682,6 +1800,8 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SVE_MAGIC = 0x53564501
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1863,7 +1983,27 @@ const (
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
TUNDETACHFILTER = 0x401054d6
@@ -1891,9 +2031,12 @@ const (
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
@@ -1935,6 +2078,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1944,7 +2167,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2124,171 +2349,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
index 4cef12d8e..fb9075317 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40041270
BLKBSZSET = 0x80041271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +969,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1037,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1074,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1108,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1117,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x8
O_ASYNC = 0x1000
@@ -1124,9 +1212,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80042406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1322,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1293,6 +1384,11 @@ const (
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1478,6 +1574,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1562,6 +1660,23 @@ const (
SIOCSPGRP = 0x80047308
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x1
@@ -1673,6 +1788,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1694,6 +1811,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1876,7 +1994,27 @@ const (
TIOCSTI = 0x5472
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x800854d5
TUNDETACHFILTER = 0x800854d6
@@ -1904,9 +2042,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x10
VEOL = 0x11
@@ -1949,6 +2090,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1958,7 +2179,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2140,174 +2363,182 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "no message of desired type",
- 36: "identifier removed",
- 37: "channel number out of range",
- 38: "level 2 not synchronized",
- 39: "level 3 halted",
- 40: "level 3 reset",
- 41: "link number out of range",
- 42: "protocol driver not attached",
- 43: "no CSI structure available",
- 44: "level 2 halted",
- 45: "resource deadlock avoided",
- 46: "no locks available",
- 50: "invalid exchange",
- 51: "invalid request descriptor",
- 52: "exchange full",
- 53: "no anode",
- 54: "invalid request code",
- 55: "invalid slot",
- 56: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 73: "RFS specific error",
- 74: "multihop attempted",
- 77: "bad message",
- 78: "file name too long",
- 79: "value too large for defined data type",
- 80: "name not unique on network",
- 81: "file descriptor in bad state",
- 82: "remote address changed",
- 83: "can not access a needed shared library",
- 84: "accessing a corrupted shared library",
- 85: ".lib section in a.out corrupted",
- 86: "attempting to link in too many shared libraries",
- 87: "cannot exec a shared library directly",
- 88: "invalid or incomplete multibyte or wide character",
- 89: "function not implemented",
- 90: "too many levels of symbolic links",
- 91: "interrupted system call should be restarted",
- 92: "streams pipe error",
- 93: "directory not empty",
- 94: "too many users",
- 95: "socket operation on non-socket",
- 96: "destination address required",
- 97: "message too long",
- 98: "protocol wrong type for socket",
- 99: "protocol not available",
- 120: "protocol not supported",
- 121: "socket type not supported",
- 122: "operation not supported",
- 123: "protocol family not supported",
- 124: "address family not supported by protocol",
- 125: "address already in use",
- 126: "cannot assign requested address",
- 127: "network is down",
- 128: "network is unreachable",
- 129: "network dropped connection on reset",
- 130: "software caused connection abort",
- 131: "connection reset by peer",
- 132: "no buffer space available",
- 133: "transport endpoint is already connected",
- 134: "transport endpoint is not connected",
- 135: "structure needs cleaning",
- 137: "not a XENIX named type file",
- 138: "no XENIX semaphores available",
- 139: "is a named type file",
- 140: "remote I/O error",
- 141: "unknown error 141",
- 142: "unknown error 142",
- 143: "cannot send after transport endpoint shutdown",
- 144: "too many references: cannot splice",
- 145: "connection timed out",
- 146: "connection refused",
- 147: "host is down",
- 148: "no route to host",
- 149: "operation already in progress",
- 150: "operation now in progress",
- 151: "stale file handle",
- 158: "operation canceled",
- 159: "no medium found",
- 160: "wrong medium type",
- 161: "required key not available",
- 162: "key has expired",
- 163: "key has been revoked",
- 164: "key was rejected by service",
- 165: "owner died",
- 166: "state not recoverable",
- 167: "operation not possible due to RF-kill",
- 168: "memory page has hardware error",
- 1133: "disk quota exceeded",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "ENOMSG", "no message of desired type"},
+ {36, "EIDRM", "identifier removed"},
+ {37, "ECHRNG", "channel number out of range"},
+ {38, "EL2NSYNC", "level 2 not synchronized"},
+ {39, "EL3HLT", "level 3 halted"},
+ {40, "EL3RST", "level 3 reset"},
+ {41, "ELNRNG", "link number out of range"},
+ {42, "EUNATCH", "protocol driver not attached"},
+ {43, "ENOCSI", "no CSI structure available"},
+ {44, "EL2HLT", "level 2 halted"},
+ {45, "EDEADLK", "resource deadlock avoided"},
+ {46, "ENOLCK", "no locks available"},
+ {50, "EBADE", "invalid exchange"},
+ {51, "EBADR", "invalid request descriptor"},
+ {52, "EXFULL", "exchange full"},
+ {53, "ENOANO", "no anode"},
+ {54, "EBADRQC", "invalid request code"},
+ {55, "EBADSLT", "invalid slot"},
+ {56, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EMULTIHOP", "multihop attempted"},
+ {77, "EBADMSG", "bad message"},
+ {78, "ENAMETOOLONG", "file name too long"},
+ {79, "EOVERFLOW", "value too large for defined data type"},
+ {80, "ENOTUNIQ", "name not unique on network"},
+ {81, "EBADFD", "file descriptor in bad state"},
+ {82, "EREMCHG", "remote address changed"},
+ {83, "ELIBACC", "can not access a needed shared library"},
+ {84, "ELIBBAD", "accessing a corrupted shared library"},
+ {85, "ELIBSCN", ".lib section in a.out corrupted"},
+ {86, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {87, "ELIBEXEC", "cannot exec a shared library directly"},
+ {88, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {89, "ENOSYS", "function not implemented"},
+ {90, "ELOOP", "too many levels of symbolic links"},
+ {91, "ERESTART", "interrupted system call should be restarted"},
+ {92, "ESTRPIPE", "streams pipe error"},
+ {93, "ENOTEMPTY", "directory not empty"},
+ {94, "EUSERS", "too many users"},
+ {95, "ENOTSOCK", "socket operation on non-socket"},
+ {96, "EDESTADDRREQ", "destination address required"},
+ {97, "EMSGSIZE", "message too long"},
+ {98, "EPROTOTYPE", "protocol wrong type for socket"},
+ {99, "ENOPROTOOPT", "protocol not available"},
+ {120, "EPROTONOSUPPORT", "protocol not supported"},
+ {121, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {122, "ENOTSUP", "operation not supported"},
+ {123, "EPFNOSUPPORT", "protocol family not supported"},
+ {124, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {125, "EADDRINUSE", "address already in use"},
+ {126, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {127, "ENETDOWN", "network is down"},
+ {128, "ENETUNREACH", "network is unreachable"},
+ {129, "ENETRESET", "network dropped connection on reset"},
+ {130, "ECONNABORTED", "software caused connection abort"},
+ {131, "ECONNRESET", "connection reset by peer"},
+ {132, "ENOBUFS", "no buffer space available"},
+ {133, "EISCONN", "transport endpoint is already connected"},
+ {134, "ENOTCONN", "transport endpoint is not connected"},
+ {135, "EUCLEAN", "structure needs cleaning"},
+ {137, "ENOTNAM", "not a XENIX named type file"},
+ {138, "ENAVAIL", "no XENIX semaphores available"},
+ {139, "EISNAM", "is a named type file"},
+ {140, "EREMOTEIO", "remote I/O error"},
+ {141, "EINIT", "unknown error 141"},
+ {142, "EREMDEV", "unknown error 142"},
+ {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {144, "ETOOMANYREFS", "too many references: cannot splice"},
+ {145, "ETIMEDOUT", "connection timed out"},
+ {146, "ECONNREFUSED", "connection refused"},
+ {147, "EHOSTDOWN", "host is down"},
+ {148, "EHOSTUNREACH", "no route to host"},
+ {149, "EALREADY", "operation already in progress"},
+ {150, "EINPROGRESS", "operation now in progress"},
+ {151, "ESTALE", "stale file handle"},
+ {158, "ECANCELED", "operation canceled"},
+ {159, "ENOMEDIUM", "no medium found"},
+ {160, "EMEDIUMTYPE", "wrong medium type"},
+ {161, "ENOKEY", "required key not available"},
+ {162, "EKEYEXPIRED", "key has expired"},
+ {163, "EKEYREVOKED", "key has been revoked"},
+ {164, "EKEYREJECTED", "key was rejected by service"},
+ {165, "EOWNERDEAD", "owner died"},
+ {166, "ENOTRECOVERABLE", "state not recoverable"},
+ {167, "ERFKILL", "operation not possible due to RF-kill"},
+ {168, "EHWPOISON", "memory page has hardware error"},
+ {1133, "EDQUOT", "disk quota exceeded"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "user defined signal 1",
- 17: "user defined signal 2",
- 18: "child exited",
- 19: "power failure",
- 20: "window changed",
- 21: "urgent I/O condition",
- 22: "I/O possible",
- 23: "stopped (signal)",
- 24: "stopped",
- 25: "continued",
- 26: "stopped (tty input)",
- 27: "stopped (tty output)",
- 28: "virtual timer expired",
- 29: "profiling timer expired",
- 30: "CPU time limit exceeded",
- 31: "file size limit exceeded",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGUSR1", "user defined signal 1"},
+ {17, "SIGUSR2", "user defined signal 2"},
+ {18, "SIGCHLD", "child exited"},
+ {19, "SIGPWR", "power failure"},
+ {20, "SIGWINCH", "window changed"},
+ {21, "SIGURG", "urgent I/O condition"},
+ {22, "SIGIO", "I/O possible"},
+ {23, "SIGSTOP", "stopped (signal)"},
+ {24, "SIGTSTP", "stopped"},
+ {25, "SIGCONT", "continued"},
+ {26, "SIGTTIN", "stopped (tty input)"},
+ {27, "SIGTTOU", "stopped (tty output)"},
+ {28, "SIGVTALRM", "virtual timer expired"},
+ {29, "SIGPROF", "profiling timer expired"},
+ {30, "SIGXCPU", "CPU time limit exceeded"},
+ {31, "SIGXFSZ", "file size limit exceeded"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
index 4782b3efb..aa6f31993 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40081270
BLKBSZSET = 0x80081271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +969,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1037,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1074,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1108,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1117,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x8
O_ASYNC = 0x1000
@@ -1124,9 +1212,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80082406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1322,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1293,6 +1384,11 @@ const (
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1478,6 +1574,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1562,6 +1660,23 @@ const (
SIOCSPGRP = 0x80047308
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x1
@@ -1673,6 +1788,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1694,6 +1811,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1876,7 +1994,27 @@ const (
TIOCSTI = 0x5472
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
TUNDETACHFILTER = 0x801054d6
@@ -1904,9 +2042,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x10
VEOL = 0x11
@@ -1949,6 +2090,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1958,7 +2179,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2140,174 +2363,182 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "no message of desired type",
- 36: "identifier removed",
- 37: "channel number out of range",
- 38: "level 2 not synchronized",
- 39: "level 3 halted",
- 40: "level 3 reset",
- 41: "link number out of range",
- 42: "protocol driver not attached",
- 43: "no CSI structure available",
- 44: "level 2 halted",
- 45: "resource deadlock avoided",
- 46: "no locks available",
- 50: "invalid exchange",
- 51: "invalid request descriptor",
- 52: "exchange full",
- 53: "no anode",
- 54: "invalid request code",
- 55: "invalid slot",
- 56: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 73: "RFS specific error",
- 74: "multihop attempted",
- 77: "bad message",
- 78: "file name too long",
- 79: "value too large for defined data type",
- 80: "name not unique on network",
- 81: "file descriptor in bad state",
- 82: "remote address changed",
- 83: "can not access a needed shared library",
- 84: "accessing a corrupted shared library",
- 85: ".lib section in a.out corrupted",
- 86: "attempting to link in too many shared libraries",
- 87: "cannot exec a shared library directly",
- 88: "invalid or incomplete multibyte or wide character",
- 89: "function not implemented",
- 90: "too many levels of symbolic links",
- 91: "interrupted system call should be restarted",
- 92: "streams pipe error",
- 93: "directory not empty",
- 94: "too many users",
- 95: "socket operation on non-socket",
- 96: "destination address required",
- 97: "message too long",
- 98: "protocol wrong type for socket",
- 99: "protocol not available",
- 120: "protocol not supported",
- 121: "socket type not supported",
- 122: "operation not supported",
- 123: "protocol family not supported",
- 124: "address family not supported by protocol",
- 125: "address already in use",
- 126: "cannot assign requested address",
- 127: "network is down",
- 128: "network is unreachable",
- 129: "network dropped connection on reset",
- 130: "software caused connection abort",
- 131: "connection reset by peer",
- 132: "no buffer space available",
- 133: "transport endpoint is already connected",
- 134: "transport endpoint is not connected",
- 135: "structure needs cleaning",
- 137: "not a XENIX named type file",
- 138: "no XENIX semaphores available",
- 139: "is a named type file",
- 140: "remote I/O error",
- 141: "unknown error 141",
- 142: "unknown error 142",
- 143: "cannot send after transport endpoint shutdown",
- 144: "too many references: cannot splice",
- 145: "connection timed out",
- 146: "connection refused",
- 147: "host is down",
- 148: "no route to host",
- 149: "operation already in progress",
- 150: "operation now in progress",
- 151: "stale file handle",
- 158: "operation canceled",
- 159: "no medium found",
- 160: "wrong medium type",
- 161: "required key not available",
- 162: "key has expired",
- 163: "key has been revoked",
- 164: "key was rejected by service",
- 165: "owner died",
- 166: "state not recoverable",
- 167: "operation not possible due to RF-kill",
- 168: "memory page has hardware error",
- 1133: "disk quota exceeded",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "ENOMSG", "no message of desired type"},
+ {36, "EIDRM", "identifier removed"},
+ {37, "ECHRNG", "channel number out of range"},
+ {38, "EL2NSYNC", "level 2 not synchronized"},
+ {39, "EL3HLT", "level 3 halted"},
+ {40, "EL3RST", "level 3 reset"},
+ {41, "ELNRNG", "link number out of range"},
+ {42, "EUNATCH", "protocol driver not attached"},
+ {43, "ENOCSI", "no CSI structure available"},
+ {44, "EL2HLT", "level 2 halted"},
+ {45, "EDEADLK", "resource deadlock avoided"},
+ {46, "ENOLCK", "no locks available"},
+ {50, "EBADE", "invalid exchange"},
+ {51, "EBADR", "invalid request descriptor"},
+ {52, "EXFULL", "exchange full"},
+ {53, "ENOANO", "no anode"},
+ {54, "EBADRQC", "invalid request code"},
+ {55, "EBADSLT", "invalid slot"},
+ {56, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EMULTIHOP", "multihop attempted"},
+ {77, "EBADMSG", "bad message"},
+ {78, "ENAMETOOLONG", "file name too long"},
+ {79, "EOVERFLOW", "value too large for defined data type"},
+ {80, "ENOTUNIQ", "name not unique on network"},
+ {81, "EBADFD", "file descriptor in bad state"},
+ {82, "EREMCHG", "remote address changed"},
+ {83, "ELIBACC", "can not access a needed shared library"},
+ {84, "ELIBBAD", "accessing a corrupted shared library"},
+ {85, "ELIBSCN", ".lib section in a.out corrupted"},
+ {86, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {87, "ELIBEXEC", "cannot exec a shared library directly"},
+ {88, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {89, "ENOSYS", "function not implemented"},
+ {90, "ELOOP", "too many levels of symbolic links"},
+ {91, "ERESTART", "interrupted system call should be restarted"},
+ {92, "ESTRPIPE", "streams pipe error"},
+ {93, "ENOTEMPTY", "directory not empty"},
+ {94, "EUSERS", "too many users"},
+ {95, "ENOTSOCK", "socket operation on non-socket"},
+ {96, "EDESTADDRREQ", "destination address required"},
+ {97, "EMSGSIZE", "message too long"},
+ {98, "EPROTOTYPE", "protocol wrong type for socket"},
+ {99, "ENOPROTOOPT", "protocol not available"},
+ {120, "EPROTONOSUPPORT", "protocol not supported"},
+ {121, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {122, "ENOTSUP", "operation not supported"},
+ {123, "EPFNOSUPPORT", "protocol family not supported"},
+ {124, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {125, "EADDRINUSE", "address already in use"},
+ {126, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {127, "ENETDOWN", "network is down"},
+ {128, "ENETUNREACH", "network is unreachable"},
+ {129, "ENETRESET", "network dropped connection on reset"},
+ {130, "ECONNABORTED", "software caused connection abort"},
+ {131, "ECONNRESET", "connection reset by peer"},
+ {132, "ENOBUFS", "no buffer space available"},
+ {133, "EISCONN", "transport endpoint is already connected"},
+ {134, "ENOTCONN", "transport endpoint is not connected"},
+ {135, "EUCLEAN", "structure needs cleaning"},
+ {137, "ENOTNAM", "not a XENIX named type file"},
+ {138, "ENAVAIL", "no XENIX semaphores available"},
+ {139, "EISNAM", "is a named type file"},
+ {140, "EREMOTEIO", "remote I/O error"},
+ {141, "EINIT", "unknown error 141"},
+ {142, "EREMDEV", "unknown error 142"},
+ {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {144, "ETOOMANYREFS", "too many references: cannot splice"},
+ {145, "ETIMEDOUT", "connection timed out"},
+ {146, "ECONNREFUSED", "connection refused"},
+ {147, "EHOSTDOWN", "host is down"},
+ {148, "EHOSTUNREACH", "no route to host"},
+ {149, "EALREADY", "operation already in progress"},
+ {150, "EINPROGRESS", "operation now in progress"},
+ {151, "ESTALE", "stale file handle"},
+ {158, "ECANCELED", "operation canceled"},
+ {159, "ENOMEDIUM", "no medium found"},
+ {160, "EMEDIUMTYPE", "wrong medium type"},
+ {161, "ENOKEY", "required key not available"},
+ {162, "EKEYEXPIRED", "key has expired"},
+ {163, "EKEYREVOKED", "key has been revoked"},
+ {164, "EKEYREJECTED", "key was rejected by service"},
+ {165, "EOWNERDEAD", "owner died"},
+ {166, "ENOTRECOVERABLE", "state not recoverable"},
+ {167, "ERFKILL", "operation not possible due to RF-kill"},
+ {168, "EHWPOISON", "memory page has hardware error"},
+ {1133, "EDQUOT", "disk quota exceeded"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "user defined signal 1",
- 17: "user defined signal 2",
- 18: "child exited",
- 19: "power failure",
- 20: "window changed",
- 21: "urgent I/O condition",
- 22: "I/O possible",
- 23: "stopped (signal)",
- 24: "stopped",
- 25: "continued",
- 26: "stopped (tty input)",
- 27: "stopped (tty output)",
- 28: "virtual timer expired",
- 29: "profiling timer expired",
- 30: "CPU time limit exceeded",
- 31: "file size limit exceeded",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGUSR1", "user defined signal 1"},
+ {17, "SIGUSR2", "user defined signal 2"},
+ {18, "SIGCHLD", "child exited"},
+ {19, "SIGPWR", "power failure"},
+ {20, "SIGWINCH", "window changed"},
+ {21, "SIGURG", "urgent I/O condition"},
+ {22, "SIGIO", "I/O possible"},
+ {23, "SIGSTOP", "stopped (signal)"},
+ {24, "SIGTSTP", "stopped"},
+ {25, "SIGCONT", "continued"},
+ {26, "SIGTTIN", "stopped (tty input)"},
+ {27, "SIGTTOU", "stopped (tty output)"},
+ {28, "SIGVTALRM", "virtual timer expired"},
+ {29, "SIGPROF", "profiling timer expired"},
+ {30, "SIGXCPU", "CPU time limit exceeded"},
+ {31, "SIGXFSZ", "file size limit exceeded"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
index 86eb3063c..9d716e2dd 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40081270
BLKBSZSET = 0x80081271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +969,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1037,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1074,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1108,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1117,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x8
O_ASYNC = 0x1000
@@ -1124,9 +1212,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80082406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1322,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1293,6 +1384,11 @@ const (
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1478,6 +1574,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1562,6 +1660,23 @@ const (
SIOCSPGRP = 0x80047308
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x1
@@ -1673,6 +1788,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1694,6 +1811,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1876,7 +1994,27 @@ const (
TIOCSTI = 0x5472
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
TUNDETACHFILTER = 0x801054d6
@@ -1904,9 +2042,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x10
VEOL = 0x11
@@ -1949,6 +2090,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1958,7 +2179,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2140,174 +2363,182 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "no message of desired type",
- 36: "identifier removed",
- 37: "channel number out of range",
- 38: "level 2 not synchronized",
- 39: "level 3 halted",
- 40: "level 3 reset",
- 41: "link number out of range",
- 42: "protocol driver not attached",
- 43: "no CSI structure available",
- 44: "level 2 halted",
- 45: "resource deadlock avoided",
- 46: "no locks available",
- 50: "invalid exchange",
- 51: "invalid request descriptor",
- 52: "exchange full",
- 53: "no anode",
- 54: "invalid request code",
- 55: "invalid slot",
- 56: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 73: "RFS specific error",
- 74: "multihop attempted",
- 77: "bad message",
- 78: "file name too long",
- 79: "value too large for defined data type",
- 80: "name not unique on network",
- 81: "file descriptor in bad state",
- 82: "remote address changed",
- 83: "can not access a needed shared library",
- 84: "accessing a corrupted shared library",
- 85: ".lib section in a.out corrupted",
- 86: "attempting to link in too many shared libraries",
- 87: "cannot exec a shared library directly",
- 88: "invalid or incomplete multibyte or wide character",
- 89: "function not implemented",
- 90: "too many levels of symbolic links",
- 91: "interrupted system call should be restarted",
- 92: "streams pipe error",
- 93: "directory not empty",
- 94: "too many users",
- 95: "socket operation on non-socket",
- 96: "destination address required",
- 97: "message too long",
- 98: "protocol wrong type for socket",
- 99: "protocol not available",
- 120: "protocol not supported",
- 121: "socket type not supported",
- 122: "operation not supported",
- 123: "protocol family not supported",
- 124: "address family not supported by protocol",
- 125: "address already in use",
- 126: "cannot assign requested address",
- 127: "network is down",
- 128: "network is unreachable",
- 129: "network dropped connection on reset",
- 130: "software caused connection abort",
- 131: "connection reset by peer",
- 132: "no buffer space available",
- 133: "transport endpoint is already connected",
- 134: "transport endpoint is not connected",
- 135: "structure needs cleaning",
- 137: "not a XENIX named type file",
- 138: "no XENIX semaphores available",
- 139: "is a named type file",
- 140: "remote I/O error",
- 141: "unknown error 141",
- 142: "unknown error 142",
- 143: "cannot send after transport endpoint shutdown",
- 144: "too many references: cannot splice",
- 145: "connection timed out",
- 146: "connection refused",
- 147: "host is down",
- 148: "no route to host",
- 149: "operation already in progress",
- 150: "operation now in progress",
- 151: "stale file handle",
- 158: "operation canceled",
- 159: "no medium found",
- 160: "wrong medium type",
- 161: "required key not available",
- 162: "key has expired",
- 163: "key has been revoked",
- 164: "key was rejected by service",
- 165: "owner died",
- 166: "state not recoverable",
- 167: "operation not possible due to RF-kill",
- 168: "memory page has hardware error",
- 1133: "disk quota exceeded",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "ENOMSG", "no message of desired type"},
+ {36, "EIDRM", "identifier removed"},
+ {37, "ECHRNG", "channel number out of range"},
+ {38, "EL2NSYNC", "level 2 not synchronized"},
+ {39, "EL3HLT", "level 3 halted"},
+ {40, "EL3RST", "level 3 reset"},
+ {41, "ELNRNG", "link number out of range"},
+ {42, "EUNATCH", "protocol driver not attached"},
+ {43, "ENOCSI", "no CSI structure available"},
+ {44, "EL2HLT", "level 2 halted"},
+ {45, "EDEADLK", "resource deadlock avoided"},
+ {46, "ENOLCK", "no locks available"},
+ {50, "EBADE", "invalid exchange"},
+ {51, "EBADR", "invalid request descriptor"},
+ {52, "EXFULL", "exchange full"},
+ {53, "ENOANO", "no anode"},
+ {54, "EBADRQC", "invalid request code"},
+ {55, "EBADSLT", "invalid slot"},
+ {56, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EMULTIHOP", "multihop attempted"},
+ {77, "EBADMSG", "bad message"},
+ {78, "ENAMETOOLONG", "file name too long"},
+ {79, "EOVERFLOW", "value too large for defined data type"},
+ {80, "ENOTUNIQ", "name not unique on network"},
+ {81, "EBADFD", "file descriptor in bad state"},
+ {82, "EREMCHG", "remote address changed"},
+ {83, "ELIBACC", "can not access a needed shared library"},
+ {84, "ELIBBAD", "accessing a corrupted shared library"},
+ {85, "ELIBSCN", ".lib section in a.out corrupted"},
+ {86, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {87, "ELIBEXEC", "cannot exec a shared library directly"},
+ {88, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {89, "ENOSYS", "function not implemented"},
+ {90, "ELOOP", "too many levels of symbolic links"},
+ {91, "ERESTART", "interrupted system call should be restarted"},
+ {92, "ESTRPIPE", "streams pipe error"},
+ {93, "ENOTEMPTY", "directory not empty"},
+ {94, "EUSERS", "too many users"},
+ {95, "ENOTSOCK", "socket operation on non-socket"},
+ {96, "EDESTADDRREQ", "destination address required"},
+ {97, "EMSGSIZE", "message too long"},
+ {98, "EPROTOTYPE", "protocol wrong type for socket"},
+ {99, "ENOPROTOOPT", "protocol not available"},
+ {120, "EPROTONOSUPPORT", "protocol not supported"},
+ {121, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {122, "ENOTSUP", "operation not supported"},
+ {123, "EPFNOSUPPORT", "protocol family not supported"},
+ {124, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {125, "EADDRINUSE", "address already in use"},
+ {126, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {127, "ENETDOWN", "network is down"},
+ {128, "ENETUNREACH", "network is unreachable"},
+ {129, "ENETRESET", "network dropped connection on reset"},
+ {130, "ECONNABORTED", "software caused connection abort"},
+ {131, "ECONNRESET", "connection reset by peer"},
+ {132, "ENOBUFS", "no buffer space available"},
+ {133, "EISCONN", "transport endpoint is already connected"},
+ {134, "ENOTCONN", "transport endpoint is not connected"},
+ {135, "EUCLEAN", "structure needs cleaning"},
+ {137, "ENOTNAM", "not a XENIX named type file"},
+ {138, "ENAVAIL", "no XENIX semaphores available"},
+ {139, "EISNAM", "is a named type file"},
+ {140, "EREMOTEIO", "remote I/O error"},
+ {141, "EINIT", "unknown error 141"},
+ {142, "EREMDEV", "unknown error 142"},
+ {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {144, "ETOOMANYREFS", "too many references: cannot splice"},
+ {145, "ETIMEDOUT", "connection timed out"},
+ {146, "ECONNREFUSED", "connection refused"},
+ {147, "EHOSTDOWN", "host is down"},
+ {148, "EHOSTUNREACH", "no route to host"},
+ {149, "EALREADY", "operation already in progress"},
+ {150, "EINPROGRESS", "operation now in progress"},
+ {151, "ESTALE", "stale file handle"},
+ {158, "ECANCELED", "operation canceled"},
+ {159, "ENOMEDIUM", "no medium found"},
+ {160, "EMEDIUMTYPE", "wrong medium type"},
+ {161, "ENOKEY", "required key not available"},
+ {162, "EKEYEXPIRED", "key has expired"},
+ {163, "EKEYREVOKED", "key has been revoked"},
+ {164, "EKEYREJECTED", "key was rejected by service"},
+ {165, "EOWNERDEAD", "owner died"},
+ {166, "ENOTRECOVERABLE", "state not recoverable"},
+ {167, "ERFKILL", "operation not possible due to RF-kill"},
+ {168, "EHWPOISON", "memory page has hardware error"},
+ {1133, "EDQUOT", "disk quota exceeded"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "user defined signal 1",
- 17: "user defined signal 2",
- 18: "child exited",
- 19: "power failure",
- 20: "window changed",
- 21: "urgent I/O condition",
- 22: "I/O possible",
- 23: "stopped (signal)",
- 24: "stopped",
- 25: "continued",
- 26: "stopped (tty input)",
- 27: "stopped (tty output)",
- 28: "virtual timer expired",
- 29: "profiling timer expired",
- 30: "CPU time limit exceeded",
- 31: "file size limit exceeded",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGUSR1", "user defined signal 1"},
+ {17, "SIGUSR2", "user defined signal 2"},
+ {18, "SIGCHLD", "child exited"},
+ {19, "SIGPWR", "power failure"},
+ {20, "SIGWINCH", "window changed"},
+ {21, "SIGURG", "urgent I/O condition"},
+ {22, "SIGIO", "I/O possible"},
+ {23, "SIGSTOP", "stopped (signal)"},
+ {24, "SIGTSTP", "stopped"},
+ {25, "SIGCONT", "continued"},
+ {26, "SIGTTIN", "stopped (tty input)"},
+ {27, "SIGTTOU", "stopped (tty output)"},
+ {28, "SIGVTALRM", "virtual timer expired"},
+ {29, "SIGPROF", "profiling timer expired"},
+ {30, "SIGXCPU", "CPU time limit exceeded"},
+ {31, "SIGXFSZ", "file size limit exceeded"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
index 2168ece94..98aa7ad24 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40041270
BLKBSZSET = 0x80041271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x80
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -895,9 +969,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -957,7 +1037,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -992,6 +1074,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1024,6 +1108,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1031,7 +1117,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x8
O_ASYNC = 0x1000
@@ -1124,9 +1212,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80042406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1232,6 +1322,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1293,6 +1384,11 @@ const (
PTRACE_SINGLESTEP = 0x9
PTRACE_SYSCALL = 0x18
PTRACE_TRACEME = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1478,6 +1574,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1562,6 +1660,23 @@ const (
SIOCSPGRP = 0x80047308
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x1
@@ -1673,6 +1788,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1694,6 +1811,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1876,7 +1994,27 @@ const (
TIOCSTI = 0x5472
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x8000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x800854d5
TUNDETACHFILTER = 0x800854d6
@@ -1904,9 +2042,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x10
VEOL = 0x11
@@ -1949,6 +2090,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -1958,7 +2179,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2140,174 +2363,182 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "no message of desired type",
- 36: "identifier removed",
- 37: "channel number out of range",
- 38: "level 2 not synchronized",
- 39: "level 3 halted",
- 40: "level 3 reset",
- 41: "link number out of range",
- 42: "protocol driver not attached",
- 43: "no CSI structure available",
- 44: "level 2 halted",
- 45: "resource deadlock avoided",
- 46: "no locks available",
- 50: "invalid exchange",
- 51: "invalid request descriptor",
- 52: "exchange full",
- 53: "no anode",
- 54: "invalid request code",
- 55: "invalid slot",
- 56: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 73: "RFS specific error",
- 74: "multihop attempted",
- 77: "bad message",
- 78: "file name too long",
- 79: "value too large for defined data type",
- 80: "name not unique on network",
- 81: "file descriptor in bad state",
- 82: "remote address changed",
- 83: "can not access a needed shared library",
- 84: "accessing a corrupted shared library",
- 85: ".lib section in a.out corrupted",
- 86: "attempting to link in too many shared libraries",
- 87: "cannot exec a shared library directly",
- 88: "invalid or incomplete multibyte or wide character",
- 89: "function not implemented",
- 90: "too many levels of symbolic links",
- 91: "interrupted system call should be restarted",
- 92: "streams pipe error",
- 93: "directory not empty",
- 94: "too many users",
- 95: "socket operation on non-socket",
- 96: "destination address required",
- 97: "message too long",
- 98: "protocol wrong type for socket",
- 99: "protocol not available",
- 120: "protocol not supported",
- 121: "socket type not supported",
- 122: "operation not supported",
- 123: "protocol family not supported",
- 124: "address family not supported by protocol",
- 125: "address already in use",
- 126: "cannot assign requested address",
- 127: "network is down",
- 128: "network is unreachable",
- 129: "network dropped connection on reset",
- 130: "software caused connection abort",
- 131: "connection reset by peer",
- 132: "no buffer space available",
- 133: "transport endpoint is already connected",
- 134: "transport endpoint is not connected",
- 135: "structure needs cleaning",
- 137: "not a XENIX named type file",
- 138: "no XENIX semaphores available",
- 139: "is a named type file",
- 140: "remote I/O error",
- 141: "unknown error 141",
- 142: "unknown error 142",
- 143: "cannot send after transport endpoint shutdown",
- 144: "too many references: cannot splice",
- 145: "connection timed out",
- 146: "connection refused",
- 147: "host is down",
- 148: "no route to host",
- 149: "operation already in progress",
- 150: "operation now in progress",
- 151: "stale file handle",
- 158: "operation canceled",
- 159: "no medium found",
- 160: "wrong medium type",
- 161: "required key not available",
- 162: "key has expired",
- 163: "key has been revoked",
- 164: "key was rejected by service",
- 165: "owner died",
- 166: "state not recoverable",
- 167: "operation not possible due to RF-kill",
- 168: "memory page has hardware error",
- 1133: "disk quota exceeded",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "ENOMSG", "no message of desired type"},
+ {36, "EIDRM", "identifier removed"},
+ {37, "ECHRNG", "channel number out of range"},
+ {38, "EL2NSYNC", "level 2 not synchronized"},
+ {39, "EL3HLT", "level 3 halted"},
+ {40, "EL3RST", "level 3 reset"},
+ {41, "ELNRNG", "link number out of range"},
+ {42, "EUNATCH", "protocol driver not attached"},
+ {43, "ENOCSI", "no CSI structure available"},
+ {44, "EL2HLT", "level 2 halted"},
+ {45, "EDEADLK", "resource deadlock avoided"},
+ {46, "ENOLCK", "no locks available"},
+ {50, "EBADE", "invalid exchange"},
+ {51, "EBADR", "invalid request descriptor"},
+ {52, "EXFULL", "exchange full"},
+ {53, "ENOANO", "no anode"},
+ {54, "EBADRQC", "invalid request code"},
+ {55, "EBADSLT", "invalid slot"},
+ {56, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EMULTIHOP", "multihop attempted"},
+ {77, "EBADMSG", "bad message"},
+ {78, "ENAMETOOLONG", "file name too long"},
+ {79, "EOVERFLOW", "value too large for defined data type"},
+ {80, "ENOTUNIQ", "name not unique on network"},
+ {81, "EBADFD", "file descriptor in bad state"},
+ {82, "EREMCHG", "remote address changed"},
+ {83, "ELIBACC", "can not access a needed shared library"},
+ {84, "ELIBBAD", "accessing a corrupted shared library"},
+ {85, "ELIBSCN", ".lib section in a.out corrupted"},
+ {86, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {87, "ELIBEXEC", "cannot exec a shared library directly"},
+ {88, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {89, "ENOSYS", "function not implemented"},
+ {90, "ELOOP", "too many levels of symbolic links"},
+ {91, "ERESTART", "interrupted system call should be restarted"},
+ {92, "ESTRPIPE", "streams pipe error"},
+ {93, "ENOTEMPTY", "directory not empty"},
+ {94, "EUSERS", "too many users"},
+ {95, "ENOTSOCK", "socket operation on non-socket"},
+ {96, "EDESTADDRREQ", "destination address required"},
+ {97, "EMSGSIZE", "message too long"},
+ {98, "EPROTOTYPE", "protocol wrong type for socket"},
+ {99, "ENOPROTOOPT", "protocol not available"},
+ {120, "EPROTONOSUPPORT", "protocol not supported"},
+ {121, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {122, "ENOTSUP", "operation not supported"},
+ {123, "EPFNOSUPPORT", "protocol family not supported"},
+ {124, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {125, "EADDRINUSE", "address already in use"},
+ {126, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {127, "ENETDOWN", "network is down"},
+ {128, "ENETUNREACH", "network is unreachable"},
+ {129, "ENETRESET", "network dropped connection on reset"},
+ {130, "ECONNABORTED", "software caused connection abort"},
+ {131, "ECONNRESET", "connection reset by peer"},
+ {132, "ENOBUFS", "no buffer space available"},
+ {133, "EISCONN", "transport endpoint is already connected"},
+ {134, "ENOTCONN", "transport endpoint is not connected"},
+ {135, "EUCLEAN", "structure needs cleaning"},
+ {137, "ENOTNAM", "not a XENIX named type file"},
+ {138, "ENAVAIL", "no XENIX semaphores available"},
+ {139, "EISNAM", "is a named type file"},
+ {140, "EREMOTEIO", "remote I/O error"},
+ {141, "EINIT", "unknown error 141"},
+ {142, "EREMDEV", "unknown error 142"},
+ {143, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {144, "ETOOMANYREFS", "too many references: cannot splice"},
+ {145, "ETIMEDOUT", "connection timed out"},
+ {146, "ECONNREFUSED", "connection refused"},
+ {147, "EHOSTDOWN", "host is down"},
+ {148, "EHOSTUNREACH", "no route to host"},
+ {149, "EALREADY", "operation already in progress"},
+ {150, "EINPROGRESS", "operation now in progress"},
+ {151, "ESTALE", "stale file handle"},
+ {158, "ECANCELED", "operation canceled"},
+ {159, "ENOMEDIUM", "no medium found"},
+ {160, "EMEDIUMTYPE", "wrong medium type"},
+ {161, "ENOKEY", "required key not available"},
+ {162, "EKEYEXPIRED", "key has expired"},
+ {163, "EKEYREVOKED", "key has been revoked"},
+ {164, "EKEYREJECTED", "key was rejected by service"},
+ {165, "EOWNERDEAD", "owner died"},
+ {166, "ENOTRECOVERABLE", "state not recoverable"},
+ {167, "ERFKILL", "operation not possible due to RF-kill"},
+ {168, "EHWPOISON", "memory page has hardware error"},
+ {1133, "EDQUOT", "disk quota exceeded"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "user defined signal 1",
- 17: "user defined signal 2",
- 18: "child exited",
- 19: "power failure",
- 20: "window changed",
- 21: "urgent I/O condition",
- 22: "I/O possible",
- 23: "stopped (signal)",
- 24: "stopped",
- 25: "continued",
- 26: "stopped (tty input)",
- 27: "stopped (tty output)",
- 28: "virtual timer expired",
- 29: "profiling timer expired",
- 30: "CPU time limit exceeded",
- 31: "file size limit exceeded",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGUSR1", "user defined signal 1"},
+ {17, "SIGUSR2", "user defined signal 2"},
+ {18, "SIGCHLD", "child exited"},
+ {19, "SIGPWR", "power failure"},
+ {20, "SIGWINCH", "window changed"},
+ {21, "SIGURG", "urgent I/O condition"},
+ {22, "SIGIO", "I/O possible"},
+ {23, "SIGSTOP", "stopped (signal)"},
+ {24, "SIGTSTP", "stopped"},
+ {25, "SIGCONT", "continued"},
+ {26, "SIGTTIN", "stopped (tty input)"},
+ {27, "SIGTTOU", "stopped (tty output)"},
+ {28, "SIGVTALRM", "virtual timer expired"},
+ {29, "SIGPROF", "profiling timer expired"},
+ {30, "SIGXCPU", "CPU time limit exceeded"},
+ {31, "SIGXFSZ", "file size limit exceeded"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
index 18e48b4f2..d545e0d7c 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x17
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x16
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40081270
BLKBSZSET = 0x80081271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x8000
BSDLY = 0x8000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0xff
CBAUDEX = 0x0
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0xff0000
CLOCAL = 0x8000
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x1000
CR2 = 0x2000
CR3 = 0x3000
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x3000
CREAD = 0x800
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x400
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x4000
IBSHIFT = 0x10
ICANON = 0x100
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x80
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x1000
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x400
IXON = 0x200
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -894,9 +968,15 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -956,7 +1036,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -991,6 +1073,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NL2 = 0x200
@@ -1025,6 +1109,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80000000
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1032,7 +1118,9 @@ const (
ONLCR = 0x2
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1125,9 +1213,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80082406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1234,6 +1324,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1349,6 +1440,11 @@ const (
PT_VSR0 = 0x96
PT_VSR31 = 0xd4
PT_XER = 0x25
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1534,6 +1630,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1618,6 +1716,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1728,6 +1843,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1749,6 +1866,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1934,7 +2052,27 @@ const (
TIOCSTOP = 0x2000746f
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x400000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
TUNDETACHFILTER = 0x801054d6
@@ -1962,9 +2100,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0x10
VEOF = 0x4
VEOL = 0x6
@@ -2006,6 +2147,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -2015,7 +2236,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4000
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0xc00
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2195,172 +2418,180 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 58: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {58, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
index c069f8fab..102f09ee1 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x17
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x16
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x40081270
BLKBSZSET = 0x80081271
BLKFLSBUF = 0x20001261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x8000
BSDLY = 0x8000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0xff
CBAUDEX = 0x0
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0xff0000
CLOCAL = 0x8000
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x1000
CR2 = 0x2000
CR3 = 0x3000
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x3000
CREAD = 0x800
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x400
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x1
ECHONL = 0x10
ECHOPRT = 0x20
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x4000
IBSHIFT = 0x10
ICANON = 0x100
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x80
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x1000
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x400
IXON = 0x200
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -894,9 +968,15 @@ const (
MCL_CURRENT = 0x2000
MCL_FUTURE = 0x4000
MCL_ONFAULT = 0x8000
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -956,7 +1036,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -991,6 +1073,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NL2 = 0x200
@@ -1025,6 +1109,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80000000
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1032,7 +1118,9 @@ const (
ONLCR = 0x2
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1125,9 +1213,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x80042408
PERF_EVENT_IOC_SET_FILTER = 0x80082406
PERF_EVENT_IOC_SET_OUTPUT = 0x20002405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1234,6 +1324,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1349,6 +1440,11 @@ const (
PT_VSR0 = 0x96
PT_VSR31 = 0xd4
PT_XER = 0x25
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1534,6 +1630,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1618,6 +1716,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1728,6 +1843,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1749,6 +1866,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1934,7 +2052,27 @@ const (
TIOCSTOP = 0x2000746f
TIOCSWINSZ = 0x80087467
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x400000
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x801054d5
TUNDETACHFILTER = 0x801054d6
@@ -1962,9 +2100,12 @@ const (
TUNSETVNETBE = 0x800454de
TUNSETVNETHDRSZ = 0x800454d8
TUNSETVNETLE = 0x800454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0x10
VEOF = 0x4
VEOL = 0x6
@@ -2006,6 +2147,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -2015,7 +2236,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4000
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0xc00
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2195,172 +2418,180 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 58: "file locking deadlock error",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {58, "EDEADLOCK", "file locking deadlock error"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
index e3f0e27e2..e8326c108 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go
@@ -11,6 +11,11 @@ package unix
import "syscall"
const (
+ AAFS_MAGIC = 0x5a3c69f0
+ ADFS_SUPER_MAGIC = 0xadf5
+ AFFS_SUPER_MAGIC = 0xadff
+ AFS_FS_MAGIC = 0x6b414653
+ AFS_SUPER_MAGIC = 0x5346414f
AF_ALG = 0x26
AF_APPLETALK = 0x5
AF_ASH = 0x12
@@ -66,6 +71,7 @@ const (
ALG_SET_IV = 0x2
ALG_SET_KEY = 0x1
ALG_SET_OP = 0x3
+ ANON_INODE_FS_MAGIC = 0x9041934
ARPHRD_6LOWPAN = 0x339
ARPHRD_ADAPT = 0x108
ARPHRD_APPLETLK = 0x8
@@ -133,6 +139,7 @@ const (
ARPHRD_VOID = 0xffff
ARPHRD_VSOCKMON = 0x33a
ARPHRD_X25 = 0x10f
+ AUTOFS_SUPER_MAGIC = 0x187
B0 = 0x0
B1000000 = 0x1008
B110 = 0x3
@@ -164,6 +171,9 @@ const (
B75 = 0x2
B921600 = 0x1007
B9600 = 0xd
+ BALLOON_KVM_MAGIC = 0x13661366
+ BDEVFS_MAGIC = 0x62646576
+ BINFMTFS_MAGIC = 0x42494e4d
BLKBSZGET = 0x80081270
BLKBSZSET = 0x40081271
BLKFLSBUF = 0x1261
@@ -188,6 +198,7 @@ const (
BPF_AND = 0x50
BPF_B = 0x10
BPF_DIV = 0x30
+ BPF_FS_MAGIC = 0xcafe4a11
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
@@ -229,6 +240,8 @@ const (
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
+ BTRFS_SUPER_MAGIC = 0x9123683e
+ BTRFS_TEST_MAGIC = 0x73727279
CAN_BCM = 0x2
CAN_EFF_FLAG = 0x80000000
CAN_EFF_ID_BITS = 0x1d
@@ -252,6 +265,8 @@ const (
CBAUD = 0x100f
CBAUDEX = 0x1000
CFLUSH = 0xf
+ CGROUP2_SUPER_MAGIC = 0x63677270
+ CGROUP_SUPER_MAGIC = 0x27e0eb
CIBAUD = 0x100f0000
CLOCAL = 0x800
CLOCK_BOOTTIME = 0x7
@@ -294,10 +309,12 @@ const (
CLONE_VFORK = 0x4000
CLONE_VM = 0x100
CMSPAR = 0x40000000
+ CODA_SUPER_MAGIC = 0x73757245
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
+ CRAMFS_MAGIC = 0x28cd3d45
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
@@ -312,6 +329,9 @@ const (
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
+ DAXFS_MAGIC = 0x64646178
+ DEBUGFS_MAGIC = 0x64626720
+ DEVPTS_SUPER_MAGIC = 0x1cd1
DT_BLK = 0x6
DT_CHR = 0x2
DT_DIR = 0x4
@@ -328,9 +348,12 @@ const (
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
+ ECRYPTFS_SUPER_MAGIC = 0xf15f
EFD_CLOEXEC = 0x80000
EFD_NONBLOCK = 0x800
EFD_SEMAPHORE = 0x1
+ EFIVARFS_MAGIC = 0xde5e81e4
+ EFS_SUPER_MAGIC = 0x414a53
ENCODING_DEFAULT = 0x0
ENCODING_FM_MARK = 0x3
ENCODING_FM_SPACE = 0x4
@@ -446,9 +469,14 @@ const (
ETH_P_WCCP = 0x883e
ETH_P_X25 = 0x805
ETH_P_XDSA = 0xf8
+ EXABYTE_ENABLE_NEST = 0xf0
+ EXT2_SUPER_MAGIC = 0xef53
+ EXT3_SUPER_MAGIC = 0xef53
+ EXT4_SUPER_MAGIC = 0xef53
EXTA = 0xe
EXTB = 0xf
EXTPROC = 0x10000
+ F2FS_SUPER_MAGIC = 0xf2f52010
FALLOC_FL_COLLAPSE_RANGE = 0x8
FALLOC_FL_INSERT_RANGE = 0x20
FALLOC_FL_KEEP_SIZE = 0x1
@@ -482,6 +510,7 @@ const (
FS_POLICY_FLAGS_PAD_8 = 0x1
FS_POLICY_FLAGS_PAD_MASK = 0x3
FS_POLICY_FLAGS_VALID = 0x3
+ FUTEXFS_SUPER_MAGIC = 0xbad1dea
F_ADD_SEALS = 0x409
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x406
@@ -543,6 +572,49 @@ const (
GENL_UNS_ADMIN_PERM = 0x10
GRND_NONBLOCK = 0x1
GRND_RANDOM = 0x2
+ HDIO_DRIVE_CMD = 0x31f
+ HDIO_DRIVE_CMD_AEB = 0x31e
+ HDIO_DRIVE_CMD_HDR_SIZE = 0x4
+ HDIO_DRIVE_HOB_HDR_SIZE = 0x8
+ HDIO_DRIVE_RESET = 0x31c
+ HDIO_DRIVE_TASK = 0x31e
+ HDIO_DRIVE_TASKFILE = 0x31d
+ HDIO_DRIVE_TASK_HDR_SIZE = 0x8
+ HDIO_GETGEO = 0x301
+ HDIO_GET_32BIT = 0x309
+ HDIO_GET_ACOUSTIC = 0x30f
+ HDIO_GET_ADDRESS = 0x310
+ HDIO_GET_BUSSTATE = 0x31a
+ HDIO_GET_DMA = 0x30b
+ HDIO_GET_IDENTITY = 0x30d
+ HDIO_GET_KEEPSETTINGS = 0x308
+ HDIO_GET_MULTCOUNT = 0x304
+ HDIO_GET_NICE = 0x30c
+ HDIO_GET_NOWERR = 0x30a
+ HDIO_GET_QDMA = 0x305
+ HDIO_GET_UNMASKINTR = 0x302
+ HDIO_GET_WCACHE = 0x30e
+ HDIO_OBSOLETE_IDENTITY = 0x307
+ HDIO_SCAN_HWIF = 0x328
+ HDIO_SET_32BIT = 0x324
+ HDIO_SET_ACOUSTIC = 0x32c
+ HDIO_SET_ADDRESS = 0x32f
+ HDIO_SET_BUSSTATE = 0x32d
+ HDIO_SET_DMA = 0x326
+ HDIO_SET_KEEPSETTINGS = 0x323
+ HDIO_SET_MULTCOUNT = 0x321
+ HDIO_SET_NICE = 0x329
+ HDIO_SET_NOWERR = 0x325
+ HDIO_SET_PIO_MODE = 0x327
+ HDIO_SET_QDMA = 0x32e
+ HDIO_SET_UNMASKINTR = 0x322
+ HDIO_SET_WCACHE = 0x32b
+ HDIO_SET_XFER = 0x306
+ HDIO_TRISTATE_HWIF = 0x31b
+ HDIO_UNREGISTER_HWIF = 0x32a
+ HOSTFS_SUPER_MAGIC = 0xc0ffee
+ HPFS_SUPER_MAGIC = 0xf995e849
+ HUGETLBFS_MAGIC = 0x958458f6
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
@@ -793,12 +865,14 @@ const (
IP_UNICAST_IF = 0x32
IP_XFRM_POLICY = 0x11
ISIG = 0x1
+ ISOFS_SUPER_MAGIC = 0x9660
ISTRIP = 0x20
IUCLC = 0x200
IUTF8 = 0x4000
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
+ JFFS2_SUPER_MAGIC = 0x72b6
KEYCTL_ASSUME_AUTHORITY = 0x10
KEYCTL_CHOWN = 0x4
KEYCTL_CLEAR = 0x7
@@ -894,9 +968,15 @@ const (
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MCL_ONFAULT = 0x4
+ MINIX2_SUPER_MAGIC = 0x2468
+ MINIX2_SUPER_MAGIC2 = 0x2478
+ MINIX3_SUPER_MAGIC = 0x4d5a
+ MINIX_SUPER_MAGIC = 0x137f
+ MINIX_SUPER_MAGIC2 = 0x138f
MNT_DETACH = 0x2
MNT_EXPIRE = 0x4
MNT_FORCE = 0x1
+ MSDOS_SUPER_MAGIC = 0x4d44
MSG_BATCH = 0x40000
MSG_CMSG_CLOEXEC = 0x40000000
MSG_CONFIRM = 0x800
@@ -956,7 +1036,9 @@ const (
MS_SYNCHRONOUS = 0x10
MS_UNBINDABLE = 0x20000
MS_VERBOSE = 0x8000
+ MTD_INODE_FS_MAGIC = 0x11307854
NAME_MAX = 0xff
+ NCP_SUPER_MAGIC = 0x564c
NETLINK_ADD_MEMBERSHIP = 0x1
NETLINK_AUDIT = 0x9
NETLINK_BROADCAST_ERROR = 0x4
@@ -991,6 +1073,8 @@ const (
NETLINK_UNUSED = 0x1
NETLINK_USERSOCK = 0x2
NETLINK_XFRM = 0x6
+ NFS_SUPER_MAGIC = 0x6969
+ NILFS_SUPER_MAGIC = 0x3434
NL0 = 0x0
NL1 = 0x100
NLA_ALIGNTO = 0x4
@@ -1023,6 +1107,8 @@ const (
NLM_F_REQUEST = 0x1
NLM_F_ROOT = 0x100
NOFLSH = 0x80
+ NSFS_MAGIC = 0x6e736673
+ OCFS2_SUPER_MAGIC = 0x7461636f
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
@@ -1030,7 +1116,9 @@ const (
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
+ OPENPROM_SUPER_MAGIC = 0x9fa1
OPOST = 0x1
+ OVERLAYFS_SUPER_MAGIC = 0x794c7630
O_ACCMODE = 0x3
O_APPEND = 0x400
O_ASYNC = 0x2000
@@ -1123,9 +1211,11 @@ const (
PERF_EVENT_IOC_SET_BPF = 0x40042408
PERF_EVENT_IOC_SET_FILTER = 0x40082406
PERF_EVENT_IOC_SET_OUTPUT = 0x2405
+ PIPEFS_MAGIC = 0x50495045
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
+ PROC_SUPER_MAGIC = 0x9fa0
PROT_EXEC = 0x4
PROT_GROWSDOWN = 0x1000000
PROT_GROWSUP = 0x2000000
@@ -1231,6 +1321,7 @@ const (
PR_TSC_SIGSEGV = 0x2
PR_UNALIGN_NOPRINT = 0x1
PR_UNALIGN_SIGBUS = 0x2
+ PSTOREFS_MAGIC = 0x6165676c
PTRACE_ATTACH = 0x10
PTRACE_CONT = 0x7
PTRACE_DETACH = 0x11
@@ -1353,6 +1444,11 @@ const (
PT_ORIGGPR2 = 0xd0
PT_PSWADDR = 0x8
PT_PSWMASK = 0x0
+ QNX4_SUPER_MAGIC = 0x2f
+ QNX6_SUPER_MAGIC = 0x68191122
+ RAMFS_MAGIC = 0x858458f6
+ RDTGROUP_SUPER_MAGIC = 0x7655821
+ REISERFS_SUPER_MAGIC = 0x52654973
RLIMIT_AS = 0x9
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
@@ -1538,6 +1634,8 @@ const (
SECCOMP_MODE_DISABLED = 0x0
SECCOMP_MODE_FILTER = 0x2
SECCOMP_MODE_STRICT = 0x1
+ SECURITYFS_MAGIC = 0x73636673
+ SELINUX_MAGIC = 0xf97cff8c
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
@@ -1622,6 +1720,23 @@ const (
SIOCSPGRP = 0x8902
SIOCSRARP = 0x8962
SIOCWANDEV = 0x894a
+ SMACK_MAGIC = 0x43415d53
+ SMART_AUTOSAVE = 0xd2
+ SMART_AUTO_OFFLINE = 0xdb
+ SMART_DISABLE = 0xd9
+ SMART_ENABLE = 0xd8
+ SMART_HCYL_PASS = 0xc2
+ SMART_IMMEDIATE_OFFLINE = 0xd4
+ SMART_LCYL_PASS = 0x4f
+ SMART_READ_LOG_SECTOR = 0xd5
+ SMART_READ_THRESHOLDS = 0xd1
+ SMART_READ_VALUES = 0xd0
+ SMART_SAVE = 0xd3
+ SMART_STATUS = 0xda
+ SMART_WRITE_LOG_SECTOR = 0xd6
+ SMART_WRITE_THRESHOLDS = 0xd7
+ SMB_SUPER_MAGIC = 0x517b
+ SOCKFS_MAGIC = 0x534f434b
SOCK_CLOEXEC = 0x80000
SOCK_DCCP = 0x6
SOCK_DGRAM = 0x2
@@ -1732,6 +1847,8 @@ const (
SPLICE_F_MORE = 0x4
SPLICE_F_MOVE = 0x1
SPLICE_F_NONBLOCK = 0x2
+ SQUASHFS_MAGIC = 0x73717368
+ STACK_END_MAGIC = 0x57ac6e9d
STATX_ALL = 0xfff
STATX_ATIME = 0x20
STATX_ATTR_APPEND = 0x20
@@ -1753,6 +1870,7 @@ const (
STATX_TYPE = 0x1
STATX_UID = 0x8
STATX__RESERVED = 0x80000000
+ SYSFS_MAGIC = 0x62656572
S_BLKSIZE = 0x200
S_IEXEC = 0x40
S_IFBLK = 0x6000
@@ -1934,7 +2052,27 @@ const (
TIOCSTI = 0x5412
TIOCSWINSZ = 0x5414
TIOCVHANGUP = 0x5437
+ TMPFS_MAGIC = 0x1021994
TOSTOP = 0x100
+ TPACKET_ALIGNMENT = 0x10
+ TPACKET_HDRLEN = 0x34
+ TP_STATUS_AVAILABLE = 0x0
+ TP_STATUS_BLK_TMO = 0x20
+ TP_STATUS_COPY = 0x2
+ TP_STATUS_CSUMNOTREADY = 0x8
+ TP_STATUS_CSUM_VALID = 0x80
+ TP_STATUS_KERNEL = 0x0
+ TP_STATUS_LOSING = 0x4
+ TP_STATUS_SENDING = 0x2
+ TP_STATUS_SEND_REQUEST = 0x1
+ TP_STATUS_TS_RAW_HARDWARE = -0x80000000
+ TP_STATUS_TS_SOFTWARE = 0x20000000
+ TP_STATUS_TS_SYS_HARDWARE = 0x40000000
+ TP_STATUS_USER = 0x1
+ TP_STATUS_VLAN_TPID_VALID = 0x40
+ TP_STATUS_VLAN_VALID = 0x10
+ TP_STATUS_WRONG_FORMAT = 0x4
+ TRACEFS_MAGIC = 0x74726163
TS_COMM_LEN = 0x20
TUNATTACHFILTER = 0x401054d5
TUNDETACHFILTER = 0x401054d6
@@ -1962,9 +2100,12 @@ const (
TUNSETVNETBE = 0x400454de
TUNSETVNETHDRSZ = 0x400454d8
TUNSETVNETLE = 0x400454dc
+ UDF_SUPER_MAGIC = 0x15013346
UMOUNT_NOFOLLOW = 0x8
+ USBDEVICE_SUPER_MAGIC = 0x9fa2
UTIME_NOW = 0x3fffffff
UTIME_OMIT = 0x3ffffffe
+ V9FS_MAGIC = 0x1021997
VDISCARD = 0xd
VEOF = 0x4
VEOL = 0xb
@@ -2006,6 +2147,86 @@ const (
WDIOC_SETPRETIMEOUT = 0xc0045708
WDIOC_SETTIMEOUT = 0xc0045706
WEXITED = 0x4
+ WIN_ACKMEDIACHANGE = 0xdb
+ WIN_CHECKPOWERMODE1 = 0xe5
+ WIN_CHECKPOWERMODE2 = 0x98
+ WIN_DEVICE_RESET = 0x8
+ WIN_DIAGNOSE = 0x90
+ WIN_DOORLOCK = 0xde
+ WIN_DOORUNLOCK = 0xdf
+ WIN_DOWNLOAD_MICROCODE = 0x92
+ WIN_FLUSH_CACHE = 0xe7
+ WIN_FLUSH_CACHE_EXT = 0xea
+ WIN_FORMAT = 0x50
+ WIN_GETMEDIASTATUS = 0xda
+ WIN_IDENTIFY = 0xec
+ WIN_IDENTIFY_DMA = 0xee
+ WIN_IDLEIMMEDIATE = 0xe1
+ WIN_INIT = 0x60
+ WIN_MEDIAEJECT = 0xed
+ WIN_MULTREAD = 0xc4
+ WIN_MULTREAD_EXT = 0x29
+ WIN_MULTWRITE = 0xc5
+ WIN_MULTWRITE_EXT = 0x39
+ WIN_NOP = 0x0
+ WIN_PACKETCMD = 0xa0
+ WIN_PIDENTIFY = 0xa1
+ WIN_POSTBOOT = 0xdc
+ WIN_PREBOOT = 0xdd
+ WIN_QUEUED_SERVICE = 0xa2
+ WIN_READ = 0x20
+ WIN_READDMA = 0xc8
+ WIN_READDMA_EXT = 0x25
+ WIN_READDMA_ONCE = 0xc9
+ WIN_READDMA_QUEUED = 0xc7
+ WIN_READDMA_QUEUED_EXT = 0x26
+ WIN_READ_BUFFER = 0xe4
+ WIN_READ_EXT = 0x24
+ WIN_READ_LONG = 0x22
+ WIN_READ_LONG_ONCE = 0x23
+ WIN_READ_NATIVE_MAX = 0xf8
+ WIN_READ_NATIVE_MAX_EXT = 0x27
+ WIN_READ_ONCE = 0x21
+ WIN_RECAL = 0x10
+ WIN_RESTORE = 0x10
+ WIN_SECURITY_DISABLE = 0xf6
+ WIN_SECURITY_ERASE_PREPARE = 0xf3
+ WIN_SECURITY_ERASE_UNIT = 0xf4
+ WIN_SECURITY_FREEZE_LOCK = 0xf5
+ WIN_SECURITY_SET_PASS = 0xf1
+ WIN_SECURITY_UNLOCK = 0xf2
+ WIN_SEEK = 0x70
+ WIN_SETFEATURES = 0xef
+ WIN_SETIDLE1 = 0xe3
+ WIN_SETIDLE2 = 0x97
+ WIN_SETMULT = 0xc6
+ WIN_SET_MAX = 0xf9
+ WIN_SET_MAX_EXT = 0x37
+ WIN_SLEEPNOW1 = 0xe6
+ WIN_SLEEPNOW2 = 0x99
+ WIN_SMART = 0xb0
+ WIN_SPECIFY = 0x91
+ WIN_SRST = 0x8
+ WIN_STANDBY = 0xe2
+ WIN_STANDBY2 = 0x96
+ WIN_STANDBYNOW1 = 0xe0
+ WIN_STANDBYNOW2 = 0x94
+ WIN_VERIFY = 0x40
+ WIN_VERIFY_EXT = 0x42
+ WIN_VERIFY_ONCE = 0x41
+ WIN_WRITE = 0x30
+ WIN_WRITEDMA = 0xca
+ WIN_WRITEDMA_EXT = 0x35
+ WIN_WRITEDMA_ONCE = 0xcb
+ WIN_WRITEDMA_QUEUED = 0xcc
+ WIN_WRITEDMA_QUEUED_EXT = 0x36
+ WIN_WRITE_BUFFER = 0xe8
+ WIN_WRITE_EXT = 0x34
+ WIN_WRITE_LONG = 0x32
+ WIN_WRITE_LONG_ONCE = 0x33
+ WIN_WRITE_ONCE = 0x31
+ WIN_WRITE_SAME = 0xe9
+ WIN_WRITE_VERIFY = 0x3c
WNOHANG = 0x1
WNOTHREAD = 0x20000000
WNOWAIT = 0x1000000
@@ -2015,7 +2236,9 @@ const (
XATTR_CREATE = 0x1
XATTR_REPLACE = 0x2
XCASE = 0x4
+ XENFS_SUPER_MAGIC = 0xabba1974
XTABS = 0x1800
+ ZSMALLOC_MAGIC = 0x58295829
)
// Errors
@@ -2195,171 +2418,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "no such device or address",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device or resource busy",
- 17: "file exists",
- 18: "invalid cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "numerical result out of range",
- 35: "resource deadlock avoided",
- 36: "file name too long",
- 37: "no locks available",
- 38: "function not implemented",
- 39: "directory not empty",
- 40: "too many levels of symbolic links",
- 42: "no message of desired type",
- 43: "identifier removed",
- 44: "channel number out of range",
- 45: "level 2 not synchronized",
- 46: "level 3 halted",
- 47: "level 3 reset",
- 48: "link number out of range",
- 49: "protocol driver not attached",
- 50: "no CSI structure available",
- 51: "level 2 halted",
- 52: "invalid exchange",
- 53: "invalid request descriptor",
- 54: "exchange full",
- 55: "no anode",
- 56: "invalid request code",
- 57: "invalid slot",
- 59: "bad font file format",
- 60: "device not a stream",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of streams resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "multihop attempted",
- 73: "RFS specific error",
- 74: "bad message",
- 75: "value too large for defined data type",
- 76: "name not unique on network",
- 77: "file descriptor in bad state",
- 78: "remote address changed",
- 79: "can not access a needed shared library",
- 80: "accessing a corrupted shared library",
- 81: ".lib section in a.out corrupted",
- 82: "attempting to link in too many shared libraries",
- 83: "cannot exec a shared library directly",
- 84: "invalid or incomplete multibyte or wide character",
- 85: "interrupted system call should be restarted",
- 86: "streams pipe error",
- 87: "too many users",
- 88: "socket operation on non-socket",
- 89: "destination address required",
- 90: "message too long",
- 91: "protocol wrong type for socket",
- 92: "protocol not available",
- 93: "protocol not supported",
- 94: "socket type not supported",
- 95: "operation not supported",
- 96: "protocol family not supported",
- 97: "address family not supported by protocol",
- 98: "address already in use",
- 99: "cannot assign requested address",
- 100: "network is down",
- 101: "network is unreachable",
- 102: "network dropped connection on reset",
- 103: "software caused connection abort",
- 104: "connection reset by peer",
- 105: "no buffer space available",
- 106: "transport endpoint is already connected",
- 107: "transport endpoint is not connected",
- 108: "cannot send after transport endpoint shutdown",
- 109: "too many references: cannot splice",
- 110: "connection timed out",
- 111: "connection refused",
- 112: "host is down",
- 113: "no route to host",
- 114: "operation already in progress",
- 115: "operation now in progress",
- 116: "stale file handle",
- 117: "structure needs cleaning",
- 118: "not a XENIX named type file",
- 119: "no XENIX semaphores available",
- 120: "is a named type file",
- 121: "remote I/O error",
- 122: "disk quota exceeded",
- 123: "no medium found",
- 124: "wrong medium type",
- 125: "operation canceled",
- 126: "required key not available",
- 127: "key has expired",
- 128: "key has been revoked",
- 129: "key was rejected by service",
- 130: "owner died",
- 131: "state not recoverable",
- 132: "operation not possible due to RF-kill",
- 133: "memory page has hardware error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device or resource busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "invalid cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "numerical result out of range"},
+ {35, "EDEADLK", "resource deadlock avoided"},
+ {36, "ENAMETOOLONG", "file name too long"},
+ {37, "ENOLCK", "no locks available"},
+ {38, "ENOSYS", "function not implemented"},
+ {39, "ENOTEMPTY", "directory not empty"},
+ {40, "ELOOP", "too many levels of symbolic links"},
+ {42, "ENOMSG", "no message of desired type"},
+ {43, "EIDRM", "identifier removed"},
+ {44, "ECHRNG", "channel number out of range"},
+ {45, "EL2NSYNC", "level 2 not synchronized"},
+ {46, "EL3HLT", "level 3 halted"},
+ {47, "EL3RST", "level 3 reset"},
+ {48, "ELNRNG", "link number out of range"},
+ {49, "EUNATCH", "protocol driver not attached"},
+ {50, "ENOCSI", "no CSI structure available"},
+ {51, "EL2HLT", "level 2 halted"},
+ {52, "EBADE", "invalid exchange"},
+ {53, "EBADR", "invalid request descriptor"},
+ {54, "EXFULL", "exchange full"},
+ {55, "ENOANO", "no anode"},
+ {56, "EBADRQC", "invalid request code"},
+ {57, "EBADSLT", "invalid slot"},
+ {59, "EBFONT", "bad font file format"},
+ {60, "ENOSTR", "device not a stream"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of streams resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "EMULTIHOP", "multihop attempted"},
+ {73, "EDOTDOT", "RFS specific error"},
+ {74, "EBADMSG", "bad message"},
+ {75, "EOVERFLOW", "value too large for defined data type"},
+ {76, "ENOTUNIQ", "name not unique on network"},
+ {77, "EBADFD", "file descriptor in bad state"},
+ {78, "EREMCHG", "remote address changed"},
+ {79, "ELIBACC", "can not access a needed shared library"},
+ {80, "ELIBBAD", "accessing a corrupted shared library"},
+ {81, "ELIBSCN", ".lib section in a.out corrupted"},
+ {82, "ELIBMAX", "attempting to link in too many shared libraries"},
+ {83, "ELIBEXEC", "cannot exec a shared library directly"},
+ {84, "EILSEQ", "invalid or incomplete multibyte or wide character"},
+ {85, "ERESTART", "interrupted system call should be restarted"},
+ {86, "ESTRPIPE", "streams pipe error"},
+ {87, "EUSERS", "too many users"},
+ {88, "ENOTSOCK", "socket operation on non-socket"},
+ {89, "EDESTADDRREQ", "destination address required"},
+ {90, "EMSGSIZE", "message too long"},
+ {91, "EPROTOTYPE", "protocol wrong type for socket"},
+ {92, "ENOPROTOOPT", "protocol not available"},
+ {93, "EPROTONOSUPPORT", "protocol not supported"},
+ {94, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {95, "ENOTSUP", "operation not supported"},
+ {96, "EPFNOSUPPORT", "protocol family not supported"},
+ {97, "EAFNOSUPPORT", "address family not supported by protocol"},
+ {98, "EADDRINUSE", "address already in use"},
+ {99, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {100, "ENETDOWN", "network is down"},
+ {101, "ENETUNREACH", "network is unreachable"},
+ {102, "ENETRESET", "network dropped connection on reset"},
+ {103, "ECONNABORTED", "software caused connection abort"},
+ {104, "ECONNRESET", "connection reset by peer"},
+ {105, "ENOBUFS", "no buffer space available"},
+ {106, "EISCONN", "transport endpoint is already connected"},
+ {107, "ENOTCONN", "transport endpoint is not connected"},
+ {108, "ESHUTDOWN", "cannot send after transport endpoint shutdown"},
+ {109, "ETOOMANYREFS", "too many references: cannot splice"},
+ {110, "ETIMEDOUT", "connection timed out"},
+ {111, "ECONNREFUSED", "connection refused"},
+ {112, "EHOSTDOWN", "host is down"},
+ {113, "EHOSTUNREACH", "no route to host"},
+ {114, "EALREADY", "operation already in progress"},
+ {115, "EINPROGRESS", "operation now in progress"},
+ {116, "ESTALE", "stale file handle"},
+ {117, "EUCLEAN", "structure needs cleaning"},
+ {118, "ENOTNAM", "not a XENIX named type file"},
+ {119, "ENAVAIL", "no XENIX semaphores available"},
+ {120, "EISNAM", "is a named type file"},
+ {121, "EREMOTEIO", "remote I/O error"},
+ {122, "EDQUOT", "disk quota exceeded"},
+ {123, "ENOMEDIUM", "no medium found"},
+ {124, "EMEDIUMTYPE", "wrong medium type"},
+ {125, "ECANCELED", "operation canceled"},
+ {126, "ENOKEY", "required key not available"},
+ {127, "EKEYEXPIRED", "key has expired"},
+ {128, "EKEYREVOKED", "key has been revoked"},
+ {129, "EKEYREJECTED", "key was rejected by service"},
+ {130, "EOWNERDEAD", "owner died"},
+ {131, "ENOTRECOVERABLE", "state not recoverable"},
+ {132, "ERFKILL", "operation not possible due to RF-kill"},
+ {133, "EHWPOISON", "memory page has hardware error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/breakpoint trap",
- 6: "aborted",
- 7: "bus error",
- 8: "floating point exception",
- 9: "killed",
- 10: "user defined signal 1",
- 11: "segmentation fault",
- 12: "user defined signal 2",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "stack fault",
- 17: "child exited",
- 18: "continued",
- 19: "stopped (signal)",
- 20: "stopped",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "urgent I/O condition",
- 24: "CPU time limit exceeded",
- 25: "file size limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window changed",
- 29: "I/O possible",
- 30: "power failure",
- 31: "bad system call",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/breakpoint trap"},
+ {6, "SIGABRT", "aborted"},
+ {7, "SIGBUS", "bus error"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGUSR1", "user defined signal 1"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGUSR2", "user defined signal 2"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGSTKFLT", "stack fault"},
+ {17, "SIGCHLD", "child exited"},
+ {18, "SIGCONT", "continued"},
+ {19, "SIGSTOP", "stopped (signal)"},
+ {20, "SIGTSTP", "stopped"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGURG", "urgent I/O condition"},
+ {24, "SIGXCPU", "CPU time limit exceeded"},
+ {25, "SIGXFSZ", "file size limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window changed"},
+ {29, "SIGIO", "I/O possible"},
+ {30, "SIGPWR", "power failure"},
+ {31, "SIGSYS", "bad system call"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
index 3eef63f5a..cd93ce0d8 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go
@@ -1584,137 +1584,145 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large or too small",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol option not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "illegal byte sequence",
- 86: "not supported",
- 87: "operation Canceled",
- 88: "bad or Corrupt message",
- 89: "no message available",
- 90: "no STREAM resources",
- 91: "not a STREAM",
- 92: "STREAM ioctl timeout",
- 93: "attribute not found",
- 94: "multihop attempted",
- 95: "link has been severed",
- 96: "protocol error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large or too small"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol option not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "connection timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EILSEQ", "illegal byte sequence"},
+ {86, "ENOTSUP", "not supported"},
+ {87, "ECANCELED", "operation Canceled"},
+ {88, "EBADMSG", "bad or Corrupt message"},
+ {89, "ENODATA", "no message available"},
+ {90, "ENOSR", "no STREAM resources"},
+ {91, "ENOSTR", "not a STREAM"},
+ {92, "ETIME", "STREAM ioctl timeout"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EMULTIHOP", "multihop attempted"},
+ {95, "ENOLINK", "link has been severed"},
+ {96, "ELAST", "protocol error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "power fail/restart",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "stopped (signal)"},
+ {18, "SIGTSTP", "stopped"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGPWR", "power fail/restart"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
index 40c870be1..071701c41 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go
@@ -1574,137 +1574,145 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large or too small",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol option not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "illegal byte sequence",
- 86: "not supported",
- 87: "operation Canceled",
- 88: "bad or Corrupt message",
- 89: "no message available",
- 90: "no STREAM resources",
- 91: "not a STREAM",
- 92: "STREAM ioctl timeout",
- 93: "attribute not found",
- 94: "multihop attempted",
- 95: "link has been severed",
- 96: "protocol error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large or too small"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol option not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "connection timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EILSEQ", "illegal byte sequence"},
+ {86, "ENOTSUP", "not supported"},
+ {87, "ECANCELED", "operation Canceled"},
+ {88, "EBADMSG", "bad or Corrupt message"},
+ {89, "ENODATA", "no message available"},
+ {90, "ENOSR", "no STREAM resources"},
+ {91, "ENOSTR", "not a STREAM"},
+ {92, "ETIME", "STREAM ioctl timeout"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EMULTIHOP", "multihop attempted"},
+ {95, "ENOLINK", "link has been severed"},
+ {96, "ELAST", "protocol error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "power fail/restart",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "stopped (signal)"},
+ {18, "SIGTSTP", "stopped"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGPWR", "power fail/restart"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
index 43c4add50..5fe56ae8c 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go
@@ -1563,137 +1563,145 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large or too small",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol option not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "identifier removed",
- 83: "no message of desired type",
- 84: "value too large to be stored in data type",
- 85: "illegal byte sequence",
- 86: "not supported",
- 87: "operation Canceled",
- 88: "bad or Corrupt message",
- 89: "no message available",
- 90: "no STREAM resources",
- 91: "not a STREAM",
- 92: "STREAM ioctl timeout",
- 93: "attribute not found",
- 94: "multihop attempted",
- 95: "link has been severed",
- 96: "protocol error",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large or too small"},
+ {35, "EAGAIN", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol option not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "connection timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disc quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC prog. not avail"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIDRM", "identifier removed"},
+ {83, "ENOMSG", "no message of desired type"},
+ {84, "EOVERFLOW", "value too large to be stored in data type"},
+ {85, "EILSEQ", "illegal byte sequence"},
+ {86, "ENOTSUP", "not supported"},
+ {87, "ECANCELED", "operation Canceled"},
+ {88, "EBADMSG", "bad or Corrupt message"},
+ {89, "ENODATA", "no message available"},
+ {90, "ENOSR", "no STREAM resources"},
+ {91, "ENOSTR", "not a STREAM"},
+ {92, "ETIME", "STREAM ioctl timeout"},
+ {93, "ENOATTR", "attribute not found"},
+ {94, "EMULTIHOP", "multihop attempted"},
+ {95, "ENOLINK", "link has been severed"},
+ {96, "ELAST", "protocol error"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "power fail/restart",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGIOT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "stopped (signal)"},
+ {18, "SIGTSTP", "stopped"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGPWR", "power fail/restart"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
index f47536dc4..0a1c3e7e8 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go
@@ -1461,132 +1461,140 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "IPsec processing failure",
- 83: "attribute not found",
- 84: "illegal byte sequence",
- 85: "no medium found",
- 86: "wrong medium type",
- 87: "value too large to be stored in data type",
- 88: "operation canceled",
- 89: "identifier removed",
- 90: "no message of desired type",
- 91: "not supported",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EWOULDBLOCK", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disk quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC program not available"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIPSEC", "IPsec processing failure"},
+ {83, "ENOATTR", "attribute not found"},
+ {84, "EILSEQ", "illegal byte sequence"},
+ {85, "ENOMEDIUM", "no medium found"},
+ {86, "EMEDIUMTYPE", "wrong medium type"},
+ {87, "EOVERFLOW", "value too large to be stored in data type"},
+ {88, "ECANCELED", "operation canceled"},
+ {89, "EIDRM", "identifier removed"},
+ {90, "ENOMSG", "no message of desired type"},
+ {91, "ELAST", "not supported"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "thread AST",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "thread AST"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
index c96ca653a..0d50f6b09 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go
@@ -1460,132 +1460,140 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "IPsec processing failure",
- 83: "attribute not found",
- 84: "illegal byte sequence",
- 85: "no medium found",
- 86: "wrong medium type",
- 87: "value too large to be stored in data type",
- 88: "operation canceled",
- 89: "identifier removed",
- 90: "no message of desired type",
- 91: "not supported",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EWOULDBLOCK", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disk quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC program not available"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIPSEC", "IPsec processing failure"},
+ {83, "ENOATTR", "attribute not found"},
+ {84, "EILSEQ", "illegal byte sequence"},
+ {85, "ENOMEDIUM", "no medium found"},
+ {86, "EMEDIUMTYPE", "wrong medium type"},
+ {87, "EOVERFLOW", "value too large to be stored in data type"},
+ {88, "ECANCELED", "operation canceled"},
+ {89, "EIDRM", "identifier removed"},
+ {90, "ENOMSG", "no message of desired type"},
+ {91, "ELAST", "not supported"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "thread AST",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "thread AST"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
index 4c027352e..93e37c4b2 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go
@@ -1463,132 +1463,140 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "operation not permitted",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "input/output error",
- 6: "device not configured",
- 7: "argument list too long",
- 8: "exec format error",
- 9: "bad file descriptor",
- 10: "no child processes",
- 11: "resource deadlock avoided",
- 12: "cannot allocate memory",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "operation not supported by device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "too many open files in system",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "numerical argument out of domain",
- 34: "result too large",
- 35: "resource temporarily unavailable",
- 36: "operation now in progress",
- 37: "operation already in progress",
- 38: "socket operation on non-socket",
- 39: "destination address required",
- 40: "message too long",
- 41: "protocol wrong type for socket",
- 42: "protocol not available",
- 43: "protocol not supported",
- 44: "socket type not supported",
- 45: "operation not supported",
- 46: "protocol family not supported",
- 47: "address family not supported by protocol family",
- 48: "address already in use",
- 49: "can't assign requested address",
- 50: "network is down",
- 51: "network is unreachable",
- 52: "network dropped connection on reset",
- 53: "software caused connection abort",
- 54: "connection reset by peer",
- 55: "no buffer space available",
- 56: "socket is already connected",
- 57: "socket is not connected",
- 58: "can't send after socket shutdown",
- 59: "too many references: can't splice",
- 60: "connection timed out",
- 61: "connection refused",
- 62: "too many levels of symbolic links",
- 63: "file name too long",
- 64: "host is down",
- 65: "no route to host",
- 66: "directory not empty",
- 67: "too many processes",
- 68: "too many users",
- 69: "disc quota exceeded",
- 70: "stale NFS file handle",
- 71: "too many levels of remote in path",
- 72: "RPC struct is bad",
- 73: "RPC version wrong",
- 74: "RPC prog. not avail",
- 75: "program version wrong",
- 76: "bad procedure for program",
- 77: "no locks available",
- 78: "function not implemented",
- 79: "inappropriate file type or format",
- 80: "authentication error",
- 81: "need authenticator",
- 82: "IPsec processing failure",
- 83: "attribute not found",
- 84: "illegal byte sequence",
- 85: "no medium found",
- 86: "wrong medium type",
- 87: "value too large to be stored in data type",
- 88: "operation canceled",
- 89: "identifier removed",
- 90: "no message of desired type",
- 91: "not supported",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "operation not permitted"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "input/output error"},
+ {6, "ENXIO", "device not configured"},
+ {7, "E2BIG", "argument list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file descriptor"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EDEADLK", "resource deadlock avoided"},
+ {12, "ENOMEM", "cannot allocate memory"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "operation not supported by device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "too many open files in system"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "numerical argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "EWOULDBLOCK", "resource temporarily unavailable"},
+ {36, "EINPROGRESS", "operation now in progress"},
+ {37, "EALREADY", "operation already in progress"},
+ {38, "ENOTSOCK", "socket operation on non-socket"},
+ {39, "EDESTADDRREQ", "destination address required"},
+ {40, "EMSGSIZE", "message too long"},
+ {41, "EPROTOTYPE", "protocol wrong type for socket"},
+ {42, "ENOPROTOOPT", "protocol not available"},
+ {43, "EPROTONOSUPPORT", "protocol not supported"},
+ {44, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {45, "EOPNOTSUPP", "operation not supported"},
+ {46, "EPFNOSUPPORT", "protocol family not supported"},
+ {47, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {48, "EADDRINUSE", "address already in use"},
+ {49, "EADDRNOTAVAIL", "can't assign requested address"},
+ {50, "ENETDOWN", "network is down"},
+ {51, "ENETUNREACH", "network is unreachable"},
+ {52, "ENETRESET", "network dropped connection on reset"},
+ {53, "ECONNABORTED", "software caused connection abort"},
+ {54, "ECONNRESET", "connection reset by peer"},
+ {55, "ENOBUFS", "no buffer space available"},
+ {56, "EISCONN", "socket is already connected"},
+ {57, "ENOTCONN", "socket is not connected"},
+ {58, "ESHUTDOWN", "can't send after socket shutdown"},
+ {59, "ETOOMANYREFS", "too many references: can't splice"},
+ {60, "ETIMEDOUT", "operation timed out"},
+ {61, "ECONNREFUSED", "connection refused"},
+ {62, "ELOOP", "too many levels of symbolic links"},
+ {63, "ENAMETOOLONG", "file name too long"},
+ {64, "EHOSTDOWN", "host is down"},
+ {65, "EHOSTUNREACH", "no route to host"},
+ {66, "ENOTEMPTY", "directory not empty"},
+ {67, "EPROCLIM", "too many processes"},
+ {68, "EUSERS", "too many users"},
+ {69, "EDQUOT", "disk quota exceeded"},
+ {70, "ESTALE", "stale NFS file handle"},
+ {71, "EREMOTE", "too many levels of remote in path"},
+ {72, "EBADRPC", "RPC struct is bad"},
+ {73, "ERPCMISMATCH", "RPC version wrong"},
+ {74, "EPROGUNAVAIL", "RPC program not available"},
+ {75, "EPROGMISMATCH", "program version wrong"},
+ {76, "EPROCUNAVAIL", "bad procedure for program"},
+ {77, "ENOLCK", "no locks available"},
+ {78, "ENOSYS", "function not implemented"},
+ {79, "EFTYPE", "inappropriate file type or format"},
+ {80, "EAUTH", "authentication error"},
+ {81, "ENEEDAUTH", "need authenticator"},
+ {82, "EIPSEC", "IPsec processing failure"},
+ {83, "ENOATTR", "attribute not found"},
+ {84, "EILSEQ", "illegal byte sequence"},
+ {85, "ENOMEDIUM", "no medium found"},
+ {86, "EMEDIUMTYPE", "wrong medium type"},
+ {87, "EOVERFLOW", "value too large to be stored in data type"},
+ {88, "ECANCELED", "operation canceled"},
+ {89, "EIDRM", "identifier removed"},
+ {90, "ENOMSG", "no message of desired type"},
+ {91, "ELAST", "not supported"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal instruction",
- 5: "trace/BPT trap",
- 6: "abort trap",
- 7: "EMT trap",
- 8: "floating point exception",
- 9: "killed",
- 10: "bus error",
- 11: "segmentation fault",
- 12: "bad system call",
- 13: "broken pipe",
- 14: "alarm clock",
- 15: "terminated",
- 16: "urgent I/O condition",
- 17: "stopped (signal)",
- 18: "stopped",
- 19: "continued",
- 20: "child exited",
- 21: "stopped (tty input)",
- 22: "stopped (tty output)",
- 23: "I/O possible",
- 24: "cputime limit exceeded",
- 25: "filesize limit exceeded",
- 26: "virtual timer expired",
- 27: "profiling timer expired",
- 28: "window size changes",
- 29: "information request",
- 30: "user defined signal 1",
- 31: "user defined signal 2",
- 32: "thread AST",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal instruction"},
+ {5, "SIGTRAP", "trace/BPT trap"},
+ {6, "SIGABRT", "abort trap"},
+ {7, "SIGEMT", "EMT trap"},
+ {8, "SIGFPE", "floating point exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus error"},
+ {11, "SIGSEGV", "segmentation fault"},
+ {12, "SIGSYS", "bad system call"},
+ {13, "SIGPIPE", "broken pipe"},
+ {14, "SIGALRM", "alarm clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGURG", "urgent I/O condition"},
+ {17, "SIGSTOP", "suspended (signal)"},
+ {18, "SIGTSTP", "suspended"},
+ {19, "SIGCONT", "continued"},
+ {20, "SIGCHLD", "child exited"},
+ {21, "SIGTTIN", "stopped (tty input)"},
+ {22, "SIGTTOU", "stopped (tty output)"},
+ {23, "SIGIO", "I/O possible"},
+ {24, "SIGXCPU", "cputime limit exceeded"},
+ {25, "SIGXFSZ", "filesize limit exceeded"},
+ {26, "SIGVTALRM", "virtual timer expired"},
+ {27, "SIGPROF", "profiling timer expired"},
+ {28, "SIGWINCH", "window size changes"},
+ {29, "SIGINFO", "information request"},
+ {30, "SIGUSR1", "user defined signal 1"},
+ {31, "SIGUSR2", "user defined signal 2"},
+ {32, "SIGTHR", "thread AST"},
}
diff --git a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
index 09eedb009..be42830cf 100644
--- a/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go
@@ -1319,171 +1319,179 @@ const (
)
// Error table
-var errors = [...]string{
- 1: "not owner",
- 2: "no such file or directory",
- 3: "no such process",
- 4: "interrupted system call",
- 5: "I/O error",
- 6: "no such device or address",
- 7: "arg list too long",
- 8: "exec format error",
- 9: "bad file number",
- 10: "no child processes",
- 11: "resource temporarily unavailable",
- 12: "not enough space",
- 13: "permission denied",
- 14: "bad address",
- 15: "block device required",
- 16: "device busy",
- 17: "file exists",
- 18: "cross-device link",
- 19: "no such device",
- 20: "not a directory",
- 21: "is a directory",
- 22: "invalid argument",
- 23: "file table overflow",
- 24: "too many open files",
- 25: "inappropriate ioctl for device",
- 26: "text file busy",
- 27: "file too large",
- 28: "no space left on device",
- 29: "illegal seek",
- 30: "read-only file system",
- 31: "too many links",
- 32: "broken pipe",
- 33: "argument out of domain",
- 34: "result too large",
- 35: "no message of desired type",
- 36: "identifier removed",
- 37: "channel number out of range",
- 38: "level 2 not synchronized",
- 39: "level 3 halted",
- 40: "level 3 reset",
- 41: "link number out of range",
- 42: "protocol driver not attached",
- 43: "no CSI structure available",
- 44: "level 2 halted",
- 45: "deadlock situation detected/avoided",
- 46: "no record locks available",
- 47: "operation canceled",
- 48: "operation not supported",
- 49: "disc quota exceeded",
- 50: "bad exchange descriptor",
- 51: "bad request descriptor",
- 52: "message tables full",
- 53: "anode table overflow",
- 54: "bad request code",
- 55: "invalid slot",
- 56: "file locking deadlock",
- 57: "bad font file format",
- 58: "owner of the lock died",
- 59: "lock is not recoverable",
- 60: "not a stream device",
- 61: "no data available",
- 62: "timer expired",
- 63: "out of stream resources",
- 64: "machine is not on the network",
- 65: "package not installed",
- 66: "object is remote",
- 67: "link has been severed",
- 68: "advertise error",
- 69: "srmount error",
- 70: "communication error on send",
- 71: "protocol error",
- 72: "locked lock was unmapped ",
- 73: "facility is not active",
- 74: "multihop attempted",
- 77: "not a data message",
- 78: "file name too long",
- 79: "value too large for defined data type",
- 80: "name not unique on network",
- 81: "file descriptor in bad state",
- 82: "remote address changed",
- 83: "can not access a needed shared library",
- 84: "accessing a corrupted shared library",
- 85: ".lib section in a.out corrupted",
- 86: "attempting to link in more shared libraries than system limit",
- 87: "can not exec a shared library directly",
- 88: "illegal byte sequence",
- 89: "operation not applicable",
- 90: "number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS",
- 91: "error 91",
- 92: "error 92",
- 93: "directory not empty",
- 94: "too many users",
- 95: "socket operation on non-socket",
- 96: "destination address required",
- 97: "message too long",
- 98: "protocol wrong type for socket",
- 99: "option not supported by protocol",
- 120: "protocol not supported",
- 121: "socket type not supported",
- 122: "operation not supported on transport endpoint",
- 123: "protocol family not supported",
- 124: "address family not supported by protocol family",
- 125: "address already in use",
- 126: "cannot assign requested address",
- 127: "network is down",
- 128: "network is unreachable",
- 129: "network dropped connection because of reset",
- 130: "software caused connection abort",
- 131: "connection reset by peer",
- 132: "no buffer space available",
- 133: "transport endpoint is already connected",
- 134: "transport endpoint is not connected",
- 143: "cannot send after socket shutdown",
- 144: "too many references: cannot splice",
- 145: "connection timed out",
- 146: "connection refused",
- 147: "host is down",
- 148: "no route to host",
- 149: "operation already in progress",
- 150: "operation now in progress",
- 151: "stale NFS file handle",
+var errorList = [...]struct {
+ num syscall.Errno
+ name string
+ desc string
+}{
+ {1, "EPERM", "not owner"},
+ {2, "ENOENT", "no such file or directory"},
+ {3, "ESRCH", "no such process"},
+ {4, "EINTR", "interrupted system call"},
+ {5, "EIO", "I/O error"},
+ {6, "ENXIO", "no such device or address"},
+ {7, "E2BIG", "arg list too long"},
+ {8, "ENOEXEC", "exec format error"},
+ {9, "EBADF", "bad file number"},
+ {10, "ECHILD", "no child processes"},
+ {11, "EAGAIN", "resource temporarily unavailable"},
+ {12, "ENOMEM", "not enough space"},
+ {13, "EACCES", "permission denied"},
+ {14, "EFAULT", "bad address"},
+ {15, "ENOTBLK", "block device required"},
+ {16, "EBUSY", "device busy"},
+ {17, "EEXIST", "file exists"},
+ {18, "EXDEV", "cross-device link"},
+ {19, "ENODEV", "no such device"},
+ {20, "ENOTDIR", "not a directory"},
+ {21, "EISDIR", "is a directory"},
+ {22, "EINVAL", "invalid argument"},
+ {23, "ENFILE", "file table overflow"},
+ {24, "EMFILE", "too many open files"},
+ {25, "ENOTTY", "inappropriate ioctl for device"},
+ {26, "ETXTBSY", "text file busy"},
+ {27, "EFBIG", "file too large"},
+ {28, "ENOSPC", "no space left on device"},
+ {29, "ESPIPE", "illegal seek"},
+ {30, "EROFS", "read-only file system"},
+ {31, "EMLINK", "too many links"},
+ {32, "EPIPE", "broken pipe"},
+ {33, "EDOM", "argument out of domain"},
+ {34, "ERANGE", "result too large"},
+ {35, "ENOMSG", "no message of desired type"},
+ {36, "EIDRM", "identifier removed"},
+ {37, "ECHRNG", "channel number out of range"},
+ {38, "EL2NSYNC", "level 2 not synchronized"},
+ {39, "EL3HLT", "level 3 halted"},
+ {40, "EL3RST", "level 3 reset"},
+ {41, "ELNRNG", "link number out of range"},
+ {42, "EUNATCH", "protocol driver not attached"},
+ {43, "ENOCSI", "no CSI structure available"},
+ {44, "EL2HLT", "level 2 halted"},
+ {45, "EDEADLK", "deadlock situation detected/avoided"},
+ {46, "ENOLCK", "no record locks available"},
+ {47, "ECANCELED", "operation canceled"},
+ {48, "ENOTSUP", "operation not supported"},
+ {49, "EDQUOT", "disc quota exceeded"},
+ {50, "EBADE", "bad exchange descriptor"},
+ {51, "EBADR", "bad request descriptor"},
+ {52, "EXFULL", "message tables full"},
+ {53, "ENOANO", "anode table overflow"},
+ {54, "EBADRQC", "bad request code"},
+ {55, "EBADSLT", "invalid slot"},
+ {56, "EDEADLOCK", "file locking deadlock"},
+ {57, "EBFONT", "bad font file format"},
+ {58, "EOWNERDEAD", "owner of the lock died"},
+ {59, "ENOTRECOVERABLE", "lock is not recoverable"},
+ {60, "ENOSTR", "not a stream device"},
+ {61, "ENODATA", "no data available"},
+ {62, "ETIME", "timer expired"},
+ {63, "ENOSR", "out of stream resources"},
+ {64, "ENONET", "machine is not on the network"},
+ {65, "ENOPKG", "package not installed"},
+ {66, "EREMOTE", "object is remote"},
+ {67, "ENOLINK", "link has been severed"},
+ {68, "EADV", "advertise error"},
+ {69, "ESRMNT", "srmount error"},
+ {70, "ECOMM", "communication error on send"},
+ {71, "EPROTO", "protocol error"},
+ {72, "ELOCKUNMAPPED", "locked lock was unmapped "},
+ {73, "ENOTACTIVE", "facility is not active"},
+ {74, "EMULTIHOP", "multihop attempted"},
+ {77, "EBADMSG", "not a data message"},
+ {78, "ENAMETOOLONG", "file name too long"},
+ {79, "EOVERFLOW", "value too large for defined data type"},
+ {80, "ENOTUNIQ", "name not unique on network"},
+ {81, "EBADFD", "file descriptor in bad state"},
+ {82, "EREMCHG", "remote address changed"},
+ {83, "ELIBACC", "can not access a needed shared library"},
+ {84, "ELIBBAD", "accessing a corrupted shared library"},
+ {85, "ELIBSCN", ".lib section in a.out corrupted"},
+ {86, "ELIBMAX", "attempting to link in more shared libraries than system limit"},
+ {87, "ELIBEXEC", "can not exec a shared library directly"},
+ {88, "EILSEQ", "illegal byte sequence"},
+ {89, "ENOSYS", "operation not applicable"},
+ {90, "ELOOP", "number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS"},
+ {91, "ERESTART", "error 91"},
+ {92, "ESTRPIPE", "error 92"},
+ {93, "ENOTEMPTY", "directory not empty"},
+ {94, "EUSERS", "too many users"},
+ {95, "ENOTSOCK", "socket operation on non-socket"},
+ {96, "EDESTADDRREQ", "destination address required"},
+ {97, "EMSGSIZE", "message too long"},
+ {98, "EPROTOTYPE", "protocol wrong type for socket"},
+ {99, "ENOPROTOOPT", "option not supported by protocol"},
+ {120, "EPROTONOSUPPORT", "protocol not supported"},
+ {121, "ESOCKTNOSUPPORT", "socket type not supported"},
+ {122, "EOPNOTSUPP", "operation not supported on transport endpoint"},
+ {123, "EPFNOSUPPORT", "protocol family not supported"},
+ {124, "EAFNOSUPPORT", "address family not supported by protocol family"},
+ {125, "EADDRINUSE", "address already in use"},
+ {126, "EADDRNOTAVAIL", "cannot assign requested address"},
+ {127, "ENETDOWN", "network is down"},
+ {128, "ENETUNREACH", "network is unreachable"},
+ {129, "ENETRESET", "network dropped connection because of reset"},
+ {130, "ECONNABORTED", "software caused connection abort"},
+ {131, "ECONNRESET", "connection reset by peer"},
+ {132, "ENOBUFS", "no buffer space available"},
+ {133, "EISCONN", "transport endpoint is already connected"},
+ {134, "ENOTCONN", "transport endpoint is not connected"},
+ {143, "ESHUTDOWN", "cannot send after socket shutdown"},
+ {144, "ETOOMANYREFS", "too many references: cannot splice"},
+ {145, "ETIMEDOUT", "connection timed out"},
+ {146, "ECONNREFUSED", "connection refused"},
+ {147, "EHOSTDOWN", "host is down"},
+ {148, "EHOSTUNREACH", "no route to host"},
+ {149, "EALREADY", "operation already in progress"},
+ {150, "EINPROGRESS", "operation now in progress"},
+ {151, "ESTALE", "stale NFS file handle"},
}
// Signal table
-var signals = [...]string{
- 1: "hangup",
- 2: "interrupt",
- 3: "quit",
- 4: "illegal Instruction",
- 5: "trace/Breakpoint Trap",
- 6: "abort",
- 7: "emulation Trap",
- 8: "arithmetic Exception",
- 9: "killed",
- 10: "bus Error",
- 11: "segmentation Fault",
- 12: "bad System Call",
- 13: "broken Pipe",
- 14: "alarm Clock",
- 15: "terminated",
- 16: "user Signal 1",
- 17: "user Signal 2",
- 18: "child Status Changed",
- 19: "power-Fail/Restart",
- 20: "window Size Change",
- 21: "urgent Socket Condition",
- 22: "pollable Event",
- 23: "stopped (signal)",
- 24: "stopped (user)",
- 25: "continued",
- 26: "stopped (tty input)",
- 27: "stopped (tty output)",
- 28: "virtual Timer Expired",
- 29: "profiling Timer Expired",
- 30: "cpu Limit Exceeded",
- 31: "file Size Limit Exceeded",
- 32: "no runnable lwp",
- 33: "inter-lwp signal",
- 34: "checkpoint Freeze",
- 35: "checkpoint Thaw",
- 36: "thread Cancellation",
- 37: "resource Lost",
- 38: "resource Control Exceeded",
- 39: "reserved for JVM 1",
- 40: "reserved for JVM 2",
- 41: "information Request",
+var signalList = [...]struct {
+ num syscall.Signal
+ name string
+ desc string
+}{
+ {1, "SIGHUP", "hangup"},
+ {2, "SIGINT", "interrupt"},
+ {3, "SIGQUIT", "quit"},
+ {4, "SIGILL", "illegal Instruction"},
+ {5, "SIGTRAP", "trace/Breakpoint Trap"},
+ {6, "SIGABRT", "abort"},
+ {7, "SIGEMT", "emulation Trap"},
+ {8, "SIGFPE", "arithmetic Exception"},
+ {9, "SIGKILL", "killed"},
+ {10, "SIGBUS", "bus Error"},
+ {11, "SIGSEGV", "segmentation Fault"},
+ {12, "SIGSYS", "bad System Call"},
+ {13, "SIGPIPE", "broken Pipe"},
+ {14, "SIGALRM", "alarm Clock"},
+ {15, "SIGTERM", "terminated"},
+ {16, "SIGUSR1", "user Signal 1"},
+ {17, "SIGUSR2", "user Signal 2"},
+ {18, "SIGCHLD", "child Status Changed"},
+ {19, "SIGPWR", "power-Fail/Restart"},
+ {20, "SIGWINCH", "window Size Change"},
+ {21, "SIGURG", "urgent Socket Condition"},
+ {22, "SIGIO", "pollable Event"},
+ {23, "SIGSTOP", "stopped (signal)"},
+ {24, "SIGTSTP", "stopped (user)"},
+ {25, "SIGCONT", "continued"},
+ {26, "SIGTTIN", "stopped (tty input)"},
+ {27, "SIGTTOU", "stopped (tty output)"},
+ {28, "SIGVTALRM", "virtual Timer Expired"},
+ {29, "SIGPROF", "profiling Timer Expired"},
+ {30, "SIGXCPU", "cpu Limit Exceeded"},
+ {31, "SIGXFSZ", "file Size Limit Exceeded"},
+ {32, "SIGWAITING", "no runnable lwp"},
+ {33, "SIGLWP", "inter-lwp signal"},
+ {34, "SIGFREEZE", "checkpoint Freeze"},
+ {35, "SIGTHAW", "checkpoint Thaw"},
+ {36, "SIGCANCEL", "thread Cancellation"},
+ {37, "SIGLOST", "resource Lost"},
+ {38, "SIGXRES", "resource Control Exceeded"},
+ {39, "SIGJVM1", "reserved for JVM 1"},
+ {40, "SIGJVM2", "reserved for JVM 2"},
+ {41, "SIGINFO", "information Request"},
}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
index ef9602c1e..433becfd0 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
index 63054b358..33c02b269 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
@@ -1784,17 +1795,6 @@ func Seek(fd int, offset int64, whence int) (off int64, err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
- r0, _, e1 := Syscall6(SYS_SELECT, uintptr(nfd), uintptr(unsafe.Pointer(r)), uintptr(unsafe.Pointer(w)), uintptr(unsafe.Pointer(e)), uintptr(unsafe.Pointer(timeout)), 0)
- n = int(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
r0, _, e1 := Syscall6(SYS_SENDFILE, uintptr(outfd), uintptr(infd), uintptr(unsafe.Pointer(offset)), uintptr(count), 0, 0)
written = int(r0)
@@ -1897,21 +1897,6 @@ func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n i
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Stat(path string, stat *Stat_t) (err error) {
- var _p0 *byte
- _p0, err = BytePtrFromString(path)
- if err != nil {
- return
- }
- _, _, e1 := Syscall(SYS_STAT, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-
func Statfs(path string, buf *Statfs_t) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(path)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
index 8b10ee144..f91b56c21 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
index 8c9e26a0a..52d759525 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
index 8dc2b58f5..970a5c132 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
@@ -1747,9 +1758,9 @@ func Shutdown(fd int, how int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
- n = int64(int64(r0)<<32 | int64(r1))
+func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
+ r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
+ n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
index e8beef850..b989d0f28 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
index 899e4403a..1f8d14cac 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
index 7a477cbde..a9c7e520e 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
@@ -1747,9 +1758,9 @@ func Shutdown(fd int, how int) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
-func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int64, err error) {
- r0, r1, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
- n = int64(int64(r1)<<32 | int64(r0))
+func Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error) {
+ r0, _, e1 := Syscall6(SYS_SPLICE, uintptr(rfd), uintptr(unsafe.Pointer(roff)), uintptr(wfd), uintptr(unsafe.Pointer(woff)), uintptr(len), uintptr(flags))
+ n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
index 9dc4c7d6d..3bb9a2099 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
index f0d1ee125..56116623d 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
index c443baf63..9696a0199 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go
@@ -995,6 +995,17 @@ func Nanosleep(time *Timespec, leftover *Timespec) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func PerfEventOpen(attr *PerfEventAttr, pid int, cpu int, groupFd int, flags int) (fd int, err error) {
+ r0, _, e1 := Syscall6(SYS_PERF_EVENT_OPEN, uintptr(unsafe.Pointer(attr)), uintptr(pid), uintptr(cpu), uintptr(groupFd), uintptr(flags), 0)
+ fd = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func PivotRoot(newroot string, putold string) (err error) {
var _p0 *byte
_p0, err = BytePtrFromString(newroot)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
index 5c09c0758..49b3b5e8a 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go
@@ -780,6 +780,17 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Getrtable() (rtable int, err error) {
+ r0, _, e1 := RawSyscall(SYS_GETRTABLE, 0, 0, 0)
+ rtable = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
@@ -1254,6 +1265,16 @@ func Setrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Setrtable(rtable int) (err error) {
+ _, _, e1 := RawSyscall(SYS_SETRTABLE, uintptr(rtable), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
index 54ccc935d..c4c7d8540 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go
@@ -780,6 +780,17 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Getrtable() (rtable int, err error) {
+ r0, _, e1 := RawSyscall(SYS_GETRTABLE, 0, 0, 0)
+ rtable = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
@@ -1254,6 +1265,16 @@ func Setrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Setrtable(rtable int) (err error) {
+ _, _, e1 := RawSyscall(SYS_SETRTABLE, uintptr(rtable), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
index 59258b0a4..210285b0b 100644
--- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go
@@ -780,6 +780,17 @@ func Getrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Getrtable() (rtable int, err error) {
+ r0, _, e1 := RawSyscall(SYS_GETRTABLE, 0, 0, 0)
+ rtable = int(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Getrusage(who int, rusage *Rusage) (err error) {
_, _, e1 := RawSyscall(SYS_GETRUSAGE, uintptr(who), uintptr(unsafe.Pointer(rusage)), 0)
if e1 != 0 {
@@ -1254,6 +1265,16 @@ func Setrlimit(which int, lim *Rlimit) (err error) {
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+func Setrtable(rtable int) (err error) {
+ _, _, e1 := RawSyscall(SYS_SETRTABLE, uintptr(rtable), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
func Setsid() (pid int, err error) {
r0, _, e1 := RawSyscall(SYS_SETSID, 0, 0, 0)
pid = int(r0)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
index 113f48b7b..84a90fa79 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go
@@ -116,21 +116,6 @@ type Stat_t struct {
Ino uint64
}
-type Statfs_t struct {
- Type int32
- Bsize int32
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int32
- Frsize int32
- Flags int32
- Spare [4]int32
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -171,7 +156,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -739,7 +724,7 @@ const (
)
type Sigset_t struct {
- _ [32]uint32
+ Val [32]uint32
}
const RNDGETENTCNT = 0x80045200
@@ -896,6 +881,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -962,3 +1118,240 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [122]int8
+ _ uint32
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ Start uint32
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int32
+ Bsize int32
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int32
+ Frsize int32
+ Flags int32
+ Spare [4]int32
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x18
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
index fa0ad6cb1..1a81adc59 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go
@@ -116,21 +116,6 @@ type Stat_t struct {
_ [3]int64
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int64
- Frsize int64
- Flags int64
- Spare [4]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -171,7 +156,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -757,7 +742,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x80045200
@@ -914,6 +899,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -980,3 +1136,242 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]int8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int64
+ Frsize int64
+ Flags int64
+ Spare [4]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
index 9b7b32e77..9746e3160 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go
@@ -117,22 +117,6 @@ type Stat_t struct {
Ino uint64
}
-type Statfs_t struct {
- Type int32
- Bsize int32
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int32
- Frsize int32
- Flags int32
- Spare [4]int32
- _ [4]byte
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -173,7 +157,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -728,7 +712,7 @@ const (
)
type Sigset_t struct {
- _ [32]uint32
+ Val [32]uint32
}
const RNDGETENTCNT = 0x80045200
@@ -885,6 +869,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -951,3 +1106,241 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [122]uint8
+ _ uint32
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ Start uint32
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int32
+ Bsize int32
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int32
+ Frsize int32
+ Flags int32
+ Spare [4]int32
+ _ [4]byte
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x18
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
index 52f8b3fa6..6e588f7ae 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go
@@ -117,21 +117,6 @@ type Stat_t struct {
_ [2]int32
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int64
- Frsize int64
- Flags int64
- Spare [4]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +157,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -736,7 +721,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x80045200
@@ -893,6 +878,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -959,3 +1115,242 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]int8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int64
+ Frsize int64
+ Flags int64
+ Spare [4]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
index 3af42dd31..27f776856 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go
@@ -115,23 +115,6 @@ type Stat_t struct {
Pad5 [14]int32
}
-type Statfs_t struct {
- Type int32
- Bsize int32
- Frsize int32
- _ [4]byte
- Blocks uint64
- Bfree uint64
- Files uint64
- Ffree uint64
- Bavail uint64
- Fsid Fsid
- Namelen int32
- Flags int32
- Spare [5]int32
- _ [4]byte
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +155,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -733,7 +716,7 @@ const (
)
type Sigset_t struct {
- _ [32]uint32
+ Val [32]uint32
}
const RNDGETENTCNT = 0x40045200
@@ -890,6 +873,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x8000000000000000
CBitFieldMaskBit1 = 0x4000000000000000
@@ -956,3 +1110,242 @@ const (
CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [122]int8
+ _ uint32
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ Start uint32
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int32
+ Bsize int32
+ Frsize int32
+ _ [4]byte
+ Blocks uint64
+ Bfree uint64
+ Files uint64
+ Ffree uint64
+ Bavail uint64
+ Fsid Fsid
+ Namelen int32
+ Flags int32
+ Spare [5]int32
+ _ [4]byte
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x18
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
index 6779a9092..069bcdd8a 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go
@@ -117,21 +117,6 @@ type Stat_t struct {
Blocks int64
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Frsize int64
- Blocks uint64
- Bfree uint64
- Files uint64
- Ffree uint64
- Bavail uint64
- Fsid Fsid
- Namelen int64
- Flags int64
- Spare [5]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +157,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -738,7 +723,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x40045200
@@ -895,6 +880,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x8000000000000000
CBitFieldMaskBit1 = 0x4000000000000000
@@ -961,3 +1117,242 @@ const (
CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]int8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Frsize int64
+ Blocks uint64
+ Bfree uint64
+ Files uint64
+ Ffree uint64
+ Bavail uint64
+ Fsid Fsid
+ Namelen int64
+ Flags int64
+ Spare [5]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
index 6c070ce01..f8bbca8f5 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go
@@ -117,21 +117,6 @@ type Stat_t struct {
Blocks int64
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Frsize int64
- Blocks uint64
- Bfree uint64
- Files uint64
- Ffree uint64
- Bavail uint64
- Fsid Fsid
- Namelen int64
- Flags int64
- Spare [5]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +157,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -738,7 +723,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x40045200
@@ -895,6 +880,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -961,3 +1117,242 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]int8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Frsize int64
+ Blocks uint64
+ Bfree uint64
+ Files uint64
+ Ffree uint64
+ Bavail uint64
+ Fsid Fsid
+ Namelen int64
+ Flags int64
+ Spare [5]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
index 57e35d13c..d35bb0e67 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go
@@ -115,23 +115,6 @@ type Stat_t struct {
Pad5 [14]int32
}
-type Statfs_t struct {
- Type int32
- Bsize int32
- Frsize int32
- _ [4]byte
- Blocks uint64
- Bfree uint64
- Files uint64
- Ffree uint64
- Bavail uint64
- Fsid Fsid
- Namelen int32
- Flags int32
- Spare [5]int32
- _ [4]byte
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +155,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -733,7 +716,7 @@ const (
)
type Sigset_t struct {
- _ [32]uint32
+ Val [32]uint32
}
const RNDGETENTCNT = 0x40045200
@@ -890,6 +873,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -956,3 +1110,242 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [122]int8
+ _ uint32
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ Start uint32
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int32
+ Bsize int32
+ Frsize int32
+ _ [4]byte
+ Blocks uint64
+ Bfree uint64
+ Files uint64
+ Ffree uint64
+ Bavail uint64
+ Fsid Fsid
+ Namelen int32
+ Flags int32
+ Spare [5]int32
+ _ [4]byte
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x18
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
index afe5de7de..b709a519e 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go
@@ -118,21 +118,6 @@ type Stat_t struct {
_ uint64
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int64
- Frsize int64
- Flags int64
- Spare [4]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -173,7 +158,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -746,7 +731,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x40045200
@@ -903,6 +888,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x8000000000000000
CBitFieldMaskBit1 = 0x4000000000000000
@@ -969,3 +1125,242 @@ const (
CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]uint8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int64
+ Frsize int64
+ Flags int64
+ Spare [4]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
index c0692890f..698eb2603 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go
@@ -118,21 +118,6 @@ type Stat_t struct {
_ uint64
}
-type Statfs_t struct {
- Type int64
- Bsize int64
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen int64
- Frsize int64
- Flags int64
- Spare [4]int64
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -173,7 +158,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -746,7 +731,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x40045200
@@ -903,6 +888,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x1
CBitFieldMaskBit1 = 0x2
@@ -969,3 +1125,242 @@ const (
CBitFieldMaskBit62 = 0x4000000000000000
CBitFieldMaskBit63 = 0x8000000000000000
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]uint8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type int64
+ Bsize int64
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen int64
+ Frsize int64
+ Flags int64
+ Spare [4]int64
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
index 1dccea95a..c2088bf91 100644
--- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go
@@ -116,22 +116,6 @@ type Stat_t struct {
_ [3]int64
}
-type Statfs_t struct {
- Type uint32
- Bsize uint32
- Blocks uint64
- Bfree uint64
- Bavail uint64
- Files uint64
- Ffree uint64
- Fsid Fsid
- Namelen uint32
- Frsize uint32
- Flags uint32
- Spare [4]uint32
- _ [4]byte
-}
-
type StatxTimestamp struct {
Sec int64
Nsec uint32
@@ -172,7 +156,7 @@ type Dirent struct {
}
type Fsid struct {
- _ [2]int32
+ Val [2]int32
}
type Flock_t struct {
@@ -763,7 +747,7 @@ const (
)
type Sigset_t struct {
- _ [16]uint64
+ Val [16]uint64
}
const RNDGETENTCNT = 0x80045200
@@ -920,6 +904,177 @@ const (
BDADDR_LE_RANDOM = 0x2
)
+type PerfEventAttr struct {
+ Type uint32
+ Size uint32
+ Config uint64
+ Sample uint64
+ Sample_type uint64
+ Read_format uint64
+ Bits uint64
+ Wakeup uint32
+ Bp_type uint32
+ Ext1 uint64
+ Ext2 uint64
+ Branch_sample_type uint64
+ Sample_regs_user uint64
+ Sample_stack_user uint32
+ Clockid int32
+ Sample_regs_intr uint64
+ Aux_watermark uint32
+ _ uint32
+}
+
+type PerfEventMmapPage struct {
+ Version uint32
+ Compat_version uint32
+ Lock uint32
+ Index uint32
+ Offset int64
+ Time_enabled uint64
+ Time_running uint64
+ Capabilities uint64
+ Pmc_width uint16
+ Time_shift uint16
+ Time_mult uint32
+ Time_offset uint64
+ Time_zero uint64
+ Size uint32
+ _ [948]uint8
+ Data_head uint64
+ Data_tail uint64
+ Data_offset uint64
+ Data_size uint64
+ Aux_head uint64
+ Aux_tail uint64
+ Aux_offset uint64
+ Aux_size uint64
+}
+
+const (
+ PerfBitDisabled uint64 = CBitFieldMaskBit0
+ PerfBitInherit = CBitFieldMaskBit1
+ PerfBitPinned = CBitFieldMaskBit2
+ PerfBitExclusive = CBitFieldMaskBit3
+ PerfBitExcludeUser = CBitFieldMaskBit4
+ PerfBitExcludeKernel = CBitFieldMaskBit5
+ PerfBitExcludeHv = CBitFieldMaskBit6
+ PerfBitExcludeIdle = CBitFieldMaskBit7
+ PerfBitMmap = CBitFieldMaskBit8
+ PerfBitComm = CBitFieldMaskBit9
+ PerfBitFreq = CBitFieldMaskBit10
+ PerfBitInheritStat = CBitFieldMaskBit11
+ PerfBitEnableOnExec = CBitFieldMaskBit12
+ PerfBitTask = CBitFieldMaskBit13
+ PerfBitWatermark = CBitFieldMaskBit14
+ PerfBitPreciseIPBit1 = CBitFieldMaskBit15
+ PerfBitPreciseIPBit2 = CBitFieldMaskBit16
+ PerfBitMmapData = CBitFieldMaskBit17
+ PerfBitSampleIDAll = CBitFieldMaskBit18
+ PerfBitExcludeHost = CBitFieldMaskBit19
+ PerfBitExcludeGuest = CBitFieldMaskBit20
+ PerfBitExcludeCallchainKernel = CBitFieldMaskBit21
+ PerfBitExcludeCallchainUser = CBitFieldMaskBit22
+ PerfBitMmap2 = CBitFieldMaskBit23
+ PerfBitCommExec = CBitFieldMaskBit24
+ PerfBitUseClockID = CBitFieldMaskBit25
+ PerfBitContextSwitch = CBitFieldMaskBit26
+)
+
+const (
+ PERF_TYPE_HARDWARE = 0x0
+ PERF_TYPE_SOFTWARE = 0x1
+ PERF_TYPE_TRACEPOINT = 0x2
+ PERF_TYPE_HW_CACHE = 0x3
+ PERF_TYPE_RAW = 0x4
+ PERF_TYPE_BREAKPOINT = 0x5
+
+ PERF_COUNT_HW_CPU_CYCLES = 0x0
+ PERF_COUNT_HW_INSTRUCTIONS = 0x1
+ PERF_COUNT_HW_CACHE_REFERENCES = 0x2
+ PERF_COUNT_HW_CACHE_MISSES = 0x3
+ PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 0x4
+ PERF_COUNT_HW_BRANCH_MISSES = 0x5
+ PERF_COUNT_HW_BUS_CYCLES = 0x6
+ PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 0x7
+ PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 0x8
+ PERF_COUNT_HW_REF_CPU_CYCLES = 0x9
+
+ PERF_COUNT_HW_CACHE_L1D = 0x0
+ PERF_COUNT_HW_CACHE_L1I = 0x1
+ PERF_COUNT_HW_CACHE_LL = 0x2
+ PERF_COUNT_HW_CACHE_DTLB = 0x3
+ PERF_COUNT_HW_CACHE_ITLB = 0x4
+ PERF_COUNT_HW_CACHE_BPU = 0x5
+ PERF_COUNT_HW_CACHE_NODE = 0x6
+
+ PERF_COUNT_HW_CACHE_OP_READ = 0x0
+ PERF_COUNT_HW_CACHE_OP_WRITE = 0x1
+ PERF_COUNT_HW_CACHE_OP_PREFETCH = 0x2
+
+ PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0x0
+ PERF_COUNT_HW_CACHE_RESULT_MISS = 0x1
+
+ PERF_COUNT_SW_CPU_CLOCK = 0x0
+ PERF_COUNT_SW_TASK_CLOCK = 0x1
+ PERF_COUNT_SW_PAGE_FAULTS = 0x2
+ PERF_COUNT_SW_CONTEXT_SWITCHES = 0x3
+ PERF_COUNT_SW_CPU_MIGRATIONS = 0x4
+ PERF_COUNT_SW_PAGE_FAULTS_MIN = 0x5
+ PERF_COUNT_SW_PAGE_FAULTS_MAJ = 0x6
+ PERF_COUNT_SW_ALIGNMENT_FAULTS = 0x7
+ PERF_COUNT_SW_EMULATION_FAULTS = 0x8
+ PERF_COUNT_SW_DUMMY = 0x9
+
+ PERF_SAMPLE_IP = 0x1
+ PERF_SAMPLE_TID = 0x2
+ PERF_SAMPLE_TIME = 0x4
+ PERF_SAMPLE_ADDR = 0x8
+ PERF_SAMPLE_READ = 0x10
+ PERF_SAMPLE_CALLCHAIN = 0x20
+ PERF_SAMPLE_ID = 0x40
+ PERF_SAMPLE_CPU = 0x80
+ PERF_SAMPLE_PERIOD = 0x100
+ PERF_SAMPLE_STREAM_ID = 0x200
+ PERF_SAMPLE_RAW = 0x400
+ PERF_SAMPLE_BRANCH_STACK = 0x800
+
+ PERF_SAMPLE_BRANCH_USER = 0x1
+ PERF_SAMPLE_BRANCH_KERNEL = 0x2
+ PERF_SAMPLE_BRANCH_HV = 0x4
+ PERF_SAMPLE_BRANCH_ANY = 0x8
+ PERF_SAMPLE_BRANCH_ANY_CALL = 0x10
+ PERF_SAMPLE_BRANCH_ANY_RETURN = 0x20
+ PERF_SAMPLE_BRANCH_IND_CALL = 0x40
+
+ PERF_FORMAT_TOTAL_TIME_ENABLED = 0x1
+ PERF_FORMAT_TOTAL_TIME_RUNNING = 0x2
+ PERF_FORMAT_ID = 0x4
+ PERF_FORMAT_GROUP = 0x8
+
+ PERF_RECORD_MMAP = 0x1
+ PERF_RECORD_LOST = 0x2
+ PERF_RECORD_COMM = 0x3
+ PERF_RECORD_EXIT = 0x4
+ PERF_RECORD_THROTTLE = 0x5
+ PERF_RECORD_UNTHROTTLE = 0x6
+ PERF_RECORD_FORK = 0x7
+ PERF_RECORD_READ = 0x8
+ PERF_RECORD_SAMPLE = 0x9
+
+ PERF_CONTEXT_HV = -0x20
+ PERF_CONTEXT_KERNEL = -0x80
+ PERF_CONTEXT_USER = -0x200
+
+ PERF_CONTEXT_GUEST = -0x800
+ PERF_CONTEXT_GUEST_KERNEL = -0x880
+ PERF_CONTEXT_GUEST_USER = -0xa00
+
+ PERF_FLAG_FD_NO_GROUP = 0x1
+ PERF_FLAG_FD_OUTPUT = 0x2
+ PERF_FLAG_PID_CGROUP = 0x4
+)
+
const (
CBitFieldMaskBit0 = 0x8000000000000000
CBitFieldMaskBit1 = 0x4000000000000000
@@ -986,3 +1141,243 @@ const (
CBitFieldMaskBit62 = 0x2
CBitFieldMaskBit63 = 0x1
)
+
+type SockaddrStorage struct {
+ Family uint16
+ _ [118]int8
+ _ uint64
+}
+
+type TCPMD5Sig struct {
+ Addr SockaddrStorage
+ Flags uint8
+ Prefixlen uint8
+ Keylen uint16
+ _ uint32
+ Key [80]uint8
+}
+
+type HDDriveCmdHdr struct {
+ Command uint8
+ Number uint8
+ Feature uint8
+ Count uint8
+}
+
+type HDGeometry struct {
+ Heads uint8
+ Sectors uint8
+ Cylinders uint16
+ _ [4]byte
+ Start uint64
+}
+
+type HDDriveID struct {
+ Config uint16
+ Cyls uint16
+ Reserved2 uint16
+ Heads uint16
+ Track_bytes uint16
+ Sector_bytes uint16
+ Sectors uint16
+ Vendor0 uint16
+ Vendor1 uint16
+ Vendor2 uint16
+ Serial_no [20]uint8
+ Buf_type uint16
+ Buf_size uint16
+ Ecc_bytes uint16
+ Fw_rev [8]uint8
+ Model [40]uint8
+ Max_multsect uint8
+ Vendor3 uint8
+ Dword_io uint16
+ Vendor4 uint8
+ Capability uint8
+ Reserved50 uint16
+ Vendor5 uint8
+ TPIO uint8
+ Vendor6 uint8
+ TDMA uint8
+ Field_valid uint16
+ Cur_cyls uint16
+ Cur_heads uint16
+ Cur_sectors uint16
+ Cur_capacity0 uint16
+ Cur_capacity1 uint16
+ Multsect uint8
+ Multsect_valid uint8
+ Lba_capacity uint32
+ Dma_1word uint16
+ Dma_mword uint16
+ Eide_pio_modes uint16
+ Eide_dma_min uint16
+ Eide_dma_time uint16
+ Eide_pio uint16
+ Eide_pio_iordy uint16
+ Words69_70 [2]uint16
+ Words71_74 [4]uint16
+ Queue_depth uint16
+ Words76_79 [4]uint16
+ Major_rev_num uint16
+ Minor_rev_num uint16
+ Command_set_1 uint16
+ Command_set_2 uint16
+ Cfsse uint16
+ Cfs_enable_1 uint16
+ Cfs_enable_2 uint16
+ Csf_default uint16
+ Dma_ultra uint16
+ Trseuc uint16
+ TrsEuc uint16
+ CurAPMvalues uint16
+ Mprc uint16
+ Hw_config uint16
+ Acoustic uint16
+ Msrqs uint16
+ Sxfert uint16
+ Sal uint16
+ Spg uint32
+ Lba_capacity_2 uint64
+ Words104_125 [22]uint16
+ Last_lun uint16
+ Word127 uint16
+ Dlf uint16
+ Csfo uint16
+ Words130_155 [26]uint16
+ Word156 uint16
+ Words157_159 [3]uint16
+ Cfa_power uint16
+ Words161_175 [15]uint16
+ Words176_205 [30]uint16
+ Words206_254 [49]uint16
+ Integrity_word uint16
+}
+
+type Statfs_t struct {
+ Type uint32
+ Bsize uint32
+ Blocks uint64
+ Bfree uint64
+ Bavail uint64
+ Files uint64
+ Ffree uint64
+ Fsid Fsid
+ Namelen uint32
+ Frsize uint32
+ Flags uint32
+ Spare [4]uint32
+ _ [4]byte
+}
+
+const (
+ ST_MANDLOCK = 0x40
+ ST_NOATIME = 0x400
+ ST_NODEV = 0x4
+ ST_NODIRATIME = 0x800
+ ST_NOEXEC = 0x8
+ ST_NOSUID = 0x2
+ ST_RDONLY = 0x1
+ ST_RELATIME = 0x1000
+ ST_SYNCHRONOUS = 0x10
+)
+
+type TpacketHdr struct {
+ Status uint64
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Usec uint32
+ _ [4]byte
+}
+
+type Tpacket2Hdr struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Sec uint32
+ Nsec uint32
+ Vlan_tci uint16
+ Vlan_tpid uint16
+ _ [4]uint8
+}
+
+type Tpacket3Hdr struct {
+ Next_offset uint32
+ Sec uint32
+ Nsec uint32
+ Snaplen uint32
+ Len uint32
+ Status uint32
+ Mac uint16
+ Net uint16
+ Hv1 TpacketHdrVariant1
+ _ [8]uint8
+}
+
+type TpacketHdrVariant1 struct {
+ Rxhash uint32
+ Vlan_tci uint32
+ Vlan_tpid uint16
+ _ uint16
+}
+
+type TpacketBlockDesc struct {
+ Version uint32
+ To_priv uint32
+ Hdr [40]byte
+}
+
+type TpacketReq struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+}
+
+type TpacketReq3 struct {
+ Block_size uint32
+ Block_nr uint32
+ Frame_size uint32
+ Frame_nr uint32
+ Retire_blk_tov uint32
+ Sizeof_priv uint32
+ Feature_req_word uint32
+}
+
+type TpacketStats struct {
+ Packets uint32
+ Drops uint32
+}
+
+type TpacketStatsV3 struct {
+ Packets uint32
+ Drops uint32
+ Freeze_q_cnt uint32
+}
+
+type TpacketAuxdata struct {
+ Status uint32
+ Len uint32
+ Snaplen uint32
+ Mac uint16
+ Net uint16
+ Vlan_tci uint16
+ Vlan_tpid uint16
+}
+
+const (
+ TPACKET_V1 = 0x0
+ TPACKET_V2 = 0x1
+ TPACKET_V3 = 0x2
+)
+
+const (
+ SizeofTpacketHdr = 0x20
+ SizeofTpacket2Hdr = 0x20
+ SizeofTpacket3Hdr = 0x30
+)
diff --git a/vendor/golang.org/x/sys/windows/asm_windows_386.s b/vendor/golang.org/x/sys/windows/asm_windows_386.s
index 1c20dd2f8..21d994d31 100644
--- a/vendor/golang.org/x/sys/windows/asm_windows_386.s
+++ b/vendor/golang.org/x/sys/windows/asm_windows_386.s
@@ -6,8 +6,8 @@
// System calls for 386, Windows are implemented in runtime/syscall_windows.goc
//
-TEXT ·getprocaddress(SB), 7, $0-8
+TEXT ·getprocaddress(SB), 7, $0-16
JMP syscall·getprocaddress(SB)
-TEXT ·loadlibrary(SB), 7, $0-4
+TEXT ·loadlibrary(SB), 7, $0-12
JMP syscall·loadlibrary(SB)
diff --git a/vendor/gopkg.in/olivere/elastic.v5/.travis.yml b/vendor/gopkg.in/olivere/elastic.v5/.travis.yml
index 82b36e7d0..9251fb7cd 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/.travis.yml
+++ b/vendor/gopkg.in/olivere/elastic.v5/.travis.yml
@@ -12,5 +12,5 @@ services:
- docker
before_install:
- sudo sysctl -w vm.max_map_count=262144
- - docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:5.6.8 elasticsearch -Expack.security.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ >& /dev/null &
+ - docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:5.6.9 elasticsearch -Expack.security.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true -Enetwork.host=_local_,_site_ -Enetwork.publish_host=_local_ >& /dev/null &
- sleep 30
diff --git a/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS b/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS
index 73a471f39..7d7c3832f 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS
+++ b/vendor/gopkg.in/olivere/elastic.v5/CONTRIBUTORS
@@ -29,6 +29,7 @@ Braden Bassingthwaite [@bbassingthwaite-va](https://github.com/bbassingthwaite-v
Brady Love [@bradylove](https://github.com/bradylove)
Bryan Conklin [@bmconklin](https://github.com/bmconklin)
Bruce Zhou [@brucez-isell](https://github.com/brucez-isell)
+César Jiménez [@cesarjimenez](https://github.com/cesarjimenez)
cforbes [@cforbes](https://github.com/cforbes)
Chris M [@tebriel](https://github.com/tebriel)
Chris Rice [@donutmonger](https://github.com/donutmonger)
@@ -61,9 +62,11 @@ Henry Clifford [@hcliff](https://github.com/hcliff)
Igor Dubinskiy [@idubinskiy](https://github.com/idubinskiy)
initialcontext [@initialcontext](https://github.com/initialcontext)
Isaac Saldana [@isaldana](https://github.com/isaldana)
+J Barkey Wolf [@jjhbw](https://github.com/jjhbw)
Jack Lindamood [@cep21](https://github.com/cep21)
Jacob [@jdelgad](https://github.com/jdelgad)
Jayme Rotsaert [@jrots](https://github.com/jrots)
+Jeff Rand [@jeffrand](https://github.com/jeffrand)
Jeremy Canady [@jrmycanady](https://github.com/jrmycanady)
Jim Berlage [@jimberlage](https://github.com/jimberlage)
Joe Buck [@four2five](https://github.com/four2five)
@@ -71,6 +74,7 @@ John Barker [@j16r](https://github.com/j16r)
John Goodall [@jgoodall](https://github.com/jgoodall)
John Stanford [@jxstanford](https://github.com/jxstanford)
Jonas Groenaas Drange [@semafor](https://github.com/semafor)
+Josef Fröhle [@Dexus](https://github.com/Dexus)
Josh Chorlton [@jchorl](https://github.com/jchorl)
jun [@coseyo](https://github.com/coseyo)
Junpei Tsuji [@jun06t](https://github.com/jun06t)
@@ -88,6 +92,8 @@ Marcy Buccellato [@marcybuccellato](https://github.com/marcybuccellato)
Mark Costello [@mcos](https://github.com/mcos)
Martin Häger [@protomouse](https://github.com/protomouse)
Medhi Bechina [@mdzor](https://github.com/mdzor)
+Mike Beshai [@mbesh](https://github.com/mbesh)
+mmfrb [@mmfrb](https://github.com/mmfrb)
mnpritula [@mnpritula](https://github.com/mnpritula)
mosa [@mosasiru](https://github.com/mosasiru)
naimulhaider [@naimulhaider](https://github.com/naimulhaider)
@@ -109,6 +115,7 @@ Sacheendra talluri [@sacheendra](https://github.com/sacheendra)
Sean DuBois [@Sean-Der](https://github.com/Sean-Der)
Shalin LK [@shalinlk](https://github.com/shalinlk)
singham [@zhaochenxiao90](https://github.com/zhaochenxiao90)
+Slawomir CALUCH [@slawo](https://github.com/slawo)
Stephen Kubovic [@stephenkubovic](https://github.com/stephenkubovic)
Stuart Warren [@Woz](https://github.com/stuart-warren)
Sulaiman [@salajlan](https://github.com/salajlan)
diff --git a/vendor/gopkg.in/olivere/elastic.v5/client.go b/vendor/gopkg.in/olivere/elastic.v5/client.go
index e709b0bf4..95debc4d9 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/client.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/client.go
@@ -26,7 +26,7 @@ import (
const (
// Version is the current version of Elastic.
- Version = "5.0.66"
+ Version = "5.0.68"
// DefaultURL is the default endpoint of Elasticsearch on the local machine.
// It is used e.g. when initializing a new Client without a specific URL.
diff --git a/vendor/gopkg.in/olivere/elastic.v5/nodes_info.go b/vendor/gopkg.in/olivere/elastic.v5/nodes_info.go
index b3687d689..d03fdf9c3 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/nodes_info.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/nodes_info.go
@@ -150,6 +150,9 @@ type NodesInfoNode struct {
// HTTPSAddress, e.g. "127.0.0.1:9200"
HTTPSAddress string `json:"https_address"`
+ // Roles of the node, e.g. [master, ingest, data]
+ Roles []string `json:"roles"`
+
// Attributes of the node.
Attributes map[string]interface{} `json:"attributes"`
diff --git a/vendor/gopkg.in/olivere/elastic.v5/run-es.sh b/vendor/gopkg.in/olivere/elastic.v5/run-es.sh
index b22e87675..26814f0d0 100755
--- a/vendor/gopkg.in/olivere/elastic.v5/run-es.sh
+++ b/vendor/gopkg.in/olivere/elastic.v5/run-es.sh
@@ -1,3 +1,3 @@
#!/bin/sh
-VERSION=${VERSION:=5.6.8}
+VERSION=${VERSION:=5.6.9}
docker run --rm --privileged=true -p 9200:9200 -p 9300:9300 -v "$PWD/etc:/usr/share/elasticsearch/config" -e "bootstrap.memory_lock=true" -e "ES_JAVA_OPTS=-Xms1g -Xmx1g" docker.elastic.co/elasticsearch/elasticsearch:$VERSION elasticsearch -Expack.security.enabled=false -Expack.ml.enabled=false -Escript.inline=true -Escript.stored=true -Escript.file=true
diff --git a/vendor/gopkg.in/olivere/elastic.v5/search_queries_fsq.go b/vendor/gopkg.in/olivere/elastic.v5/search_queries_fsq.go
index ec34302f8..82821b0b6 100644
--- a/vendor/gopkg.in/olivere/elastic.v5/search_queries_fsq.go
+++ b/vendor/gopkg.in/olivere/elastic.v5/search_queries_fsq.go
@@ -114,18 +114,7 @@ func (q *FunctionScoreQuery) Source() (interface{}, error) {
query["filter"] = src
}
- if len(q.filters) == 1 && q.filters[0] == nil {
- // Weight needs to be serialized on this level.
- if weight := q.scoreFuncs[0].GetWeight(); weight != nil {
- query["weight"] = weight
- }
- // Serialize the score function
- src, err := q.scoreFuncs[0].Source()
- if err != nil {
- return nil, err
- }
- query[q.scoreFuncs[0].Name()] = src
- } else {
+ if len(q.filters) > 0 {
funcs := make([]interface{}, len(q.filters))
for i, filter := range q.filters {
hsh := make(map[string]interface{})