diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..975fa33
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,23 @@
+on: [push, pull_request]
+name: Test
+jobs:
+ test:
+ strategy:
+ matrix:
+ go-version: [1.19.x]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Install Go
+ uses: actions/setup-go@v3
+ with:
+ go-version: ${{ matrix.go-version }}
+ - uses: actions/checkout@v3
+ with:
+ path: './src/github.com/kevinburke/chroma-markdown'
+ # staticcheck needs this for GOPATH
+ - run: |
+ echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
+ echo "PATH=$GITHUB_WORKSPACE/bin:$PATH" >> $GITHUB_ENV
+ - name: Run tests
+ run: make test
+ working-directory: './src/github.com/kevinburke/chroma-markdown'
diff --git a/Gopkg.lock b/Gopkg.lock
deleted file mode 100644
index 74d77fc..0000000
--- a/Gopkg.lock
+++ /dev/null
@@ -1,75 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- digest = "1:1ac38c116b56bcb0729b224191e3d2bc86883cd0b82d02c3ea0b006db395de91"
- name = "github.com/alecthomas/chroma"
- packages = [
- ".",
- "formatters/html",
- "lexers",
- "lexers/a",
- "lexers/b",
- "lexers/c",
- "lexers/circular",
- "lexers/d",
- "lexers/e",
- "lexers/f",
- "lexers/g",
- "lexers/h",
- "lexers/i",
- "lexers/internal",
- "lexers/j",
- "lexers/k",
- "lexers/l",
- "lexers/m",
- "lexers/n",
- "lexers/o",
- "lexers/p",
- "lexers/q",
- "lexers/r",
- "lexers/s",
- "lexers/t",
- "lexers/v",
- "lexers/w",
- "lexers/x",
- "lexers/y",
- "lexers/z",
- "styles",
- ]
- pruneopts = "UT"
- revision = "v0.9.4"
-
-[[projects]]
- digest = "1:1d760033af7697966e33f900ddd0e68bfa2637b50fa25e7384e45f73f54e3276"
- name = "github.com/dlclark/regexp2"
- packages = [
- ".",
- "syntax",
- ]
- pruneopts = "UT"
- revision = "v1.4.0"
-
-[[projects]]
- branch = "master"
- digest = "1:b1e96c96cf2bfb86229921c95c15c34b56dbaffac891ee24c365ac527aaf5b80"
- name = "golang.org/x/sys"
- packages = [
- "internal/unsafeheader",
- "unix",
- ]
- pruneopts = "UT"
- revision = "da31bd327af904dd4721b4eefa7c505bb3afd214"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- input-imports = [
- "github.com/alecthomas/chroma",
- "github.com/alecthomas/chroma/formatters/html",
- "github.com/alecthomas/chroma/lexers",
- "github.com/alecthomas/chroma/styles",
- "golang.org/x/sys/unix",
- ]
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
deleted file mode 100644
index f42418e..0000000
--- a/Gopkg.toml
+++ /dev/null
@@ -1,15 +0,0 @@
-[prune]
- unused-packages = true
- go-tests = true
-
-[[constraint]]
- name = "github.com/alecthomas/chroma"
- revision = "v0.9.4"
-
-[[override]]
- name = "github.com/dlclark/regexp2"
- revision = "v1.4.0"
-
-[[constraint]]
- name = "golang.org/x/sys"
- branch = "master"
diff --git a/Makefile b/Makefile
index 84a9bf5..0d32aca 100644
--- a/Makefile
+++ b/Makefile
@@ -3,15 +3,14 @@ RELEASE := $(GOPATH)/bin/github-release
UNAME := $(shell uname)
-$(STATICCHECK):
- go get honnef.co/go/tools/cmd/staticcheck
-vet: $(STATICCHECK)
- go list ./... | grep -v vendor | xargs go vet
- go list ./... | grep -v vendor | xargs $(STATICCHECK)
+vet:
+ go vet ./...
+ go install honnef.co/go/tools/cmd/staticcheck@latest
+ staticcheck ./...
test: vet
- go list ./... | grep -v vendor | xargs go test
+ go test ./...
$(RELEASE): test
go get -u github.com/aktau/github-release
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..d43f7d7
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,10 @@
+module github.com/kevinburke/chroma-markdown
+
+go 1.20
+
+require (
+ github.com/alecthomas/chroma v0.10.0
+ golang.org/x/sys v0.4.0
+)
+
+require github.com/dlclark/regexp2 v1.8.0 // indirect
diff --git a/vendor/github.com/alecthomas/chroma/go.sum b/go.sum
similarity index 68%
rename from vendor/github.com/alecthomas/chroma/go.sum
rename to go.sum
index 734f796..9fac84b 100644
--- a/vendor/github.com/alecthomas/chroma/go.sum
+++ b/go.sum
@@ -1,14 +1,18 @@
+github.com/alecthomas/chroma v0.10.0 h1:7XDcGkCQopCNKjZHfYrNLraA+M7e0fMiJ/Mfikbfjek=
+github.com/alecthomas/chroma v0.10.0/go.mod h1:jtJATyUxlIORhUOFNA9NZDWGAQ8wpxQQqNSB4rjA/1s=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
-github.com/dlclark/regexp2 v1.4.0 h1:F1rxgk7p4uKjwIQxBs9oAXe5CqrXlCduYEJvrF4u93E=
github.com/dlclark/regexp2 v1.4.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc=
+github.com/dlclark/regexp2 v1.8.0 h1:rJD5HeGIT/2b5CDk63FVCwZA3qgYElfg+oQK7uH5pfE=
+github.com/dlclark/regexp2 v1.8.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
-gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
+golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
diff --git a/vendor/github.com/alecthomas/chroma/Makefile b/vendor/github.com/alecthomas/chroma/Makefile
index 010ec03..34e3c41 100644
--- a/vendor/github.com/alecthomas/chroma/Makefile
+++ b/vendor/github.com/alecthomas/chroma/Makefile
@@ -12,7 +12,7 @@ tokentype_string.go: types.go
chromad:
rm -f chromad
- (export CGOENABLED=0 GOOS=linux ; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../chromad .)
+ (export CGOENABLED=0 GOOS=linux GOARCH=amd64; cd ./cmd/chromad && go build -ldflags="-X 'main.version=$(VERSION)'" -o ../../chromad .)
upload: chromad
scp chromad root@swapoff.org: && \
diff --git a/vendor/github.com/alecthomas/chroma/README.md b/vendor/github.com/alecthomas/chroma/README.md
index 7786fe1..b62b847 100644
--- a/vendor/github.com/alecthomas/chroma/README.md
+++ b/vendor/github.com/alecthomas/chroma/README.md
@@ -37,7 +37,7 @@ translators for Pygments lexers and styles.
Prefix | Language
:----: | --------
A | ABAP, ABNF, ActionScript, ActionScript 3, Ada, Angular2, ANTLR, ApacheConf, APL, AppleScript, Arduino, Awk
-B | Ballerina, Base Makefile, Bash, Batchfile, BibTeX, BlitzBasic, BNF, Brainfuck
+B | Ballerina, Base Makefile, Bash, Batchfile, BibTeX, Bicep, BlitzBasic, BNF, Brainfuck
C | C, C#, C++, Caddyfile, Caddyfile Directives, Cap'n Proto, Cassandra CQL, Ceylon, CFEngine3, cfstatement, ChaiScript, Cheetah, Clojure, CMake, COBOL, CoffeeScript, Common Lisp, Coq, Crystal, CSS, Cython
D | D, Dart, Diff, Django/Jinja, Docker, DTD, Dylan
E | EBNF, Elixir, Elm, EmacsLisp, Erlang
@@ -50,7 +50,7 @@ K | Kotlin
L | Lighttpd configuration file, LLVM, Lua
M | Mako, markdown, Mason, Mathematica, Matlab, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL
N | NASM, Newspeak, Nginx configuration file, Nim, Nix
-O | Objective-C, OCaml, Octave, OnesEnterprise, OpenSCAD, Org Mode
+O | Objective-C, OCaml, Octave, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode
P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerShell, Prolog, PromQL, Protocol Buffer, Puppet, Python 2, Python
Q | QBasic
R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust
diff --git a/vendor/github.com/alecthomas/chroma/bin/.go-1.16.3.pkg b/vendor/github.com/alecthomas/chroma/bin/.go-1.16.3.pkg
deleted file mode 120000
index 383f451..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/.go-1.16.3.pkg
+++ /dev/null
@@ -1 +0,0 @@
-hermit
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/.golangci-lint-1.37.0.pkg b/vendor/github.com/alecthomas/chroma/bin/.golangci-lint-1.37.0.pkg
deleted file mode 120000
index 383f451..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/.golangci-lint-1.37.0.pkg
+++ /dev/null
@@ -1 +0,0 @@
-hermit
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/.goreleaser-0.182.1.pkg b/vendor/github.com/alecthomas/chroma/bin/.goreleaser-0.182.1.pkg
deleted file mode 120000
index 383f451..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/.goreleaser-0.182.1.pkg
+++ /dev/null
@@ -1 +0,0 @@
-hermit
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/go b/vendor/github.com/alecthomas/chroma/bin/go
deleted file mode 120000
index 1fd74de..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/go
+++ /dev/null
@@ -1 +0,0 @@
-.go-1.16.3.pkg
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/gofmt b/vendor/github.com/alecthomas/chroma/bin/gofmt
deleted file mode 120000
index 1fd74de..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/gofmt
+++ /dev/null
@@ -1 +0,0 @@
-.go-1.16.3.pkg
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/golangci-lint b/vendor/github.com/alecthomas/chroma/bin/golangci-lint
deleted file mode 120000
index cf27348..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/golangci-lint
+++ /dev/null
@@ -1 +0,0 @@
-.golangci-lint-1.37.0.pkg
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/bin/goreleaser b/vendor/github.com/alecthomas/chroma/bin/goreleaser
deleted file mode 120000
index 0907ca5..0000000
--- a/vendor/github.com/alecthomas/chroma/bin/goreleaser
+++ /dev/null
@@ -1 +0,0 @@
-.goreleaser-0.182.1.pkg
\ No newline at end of file
diff --git a/vendor/github.com/alecthomas/chroma/formatters/html/html.go b/vendor/github.com/alecthomas/chroma/formatters/html/html.go
index 5121529..164c842 100644
--- a/vendor/github.com/alecthomas/chroma/formatters/html/html.go
+++ b/vendor/github.com/alecthomas/chroma/formatters/html/html.go
@@ -46,6 +46,13 @@ func WithPreWrapper(wrapper PreWrapper) Option {
}
}
+// WrapLongLines wraps long lines.
+func WrapLongLines(b bool) Option {
+ return func(f *Formatter) {
+ f.wrapLongLines = b
+ }
+}
+
// WithLineNumbers formats output with line numbers.
func WithLineNumbers(b bool) Option {
return func(f *Formatter) {
@@ -131,10 +138,18 @@ var (
}
defaultPreWrapper = preWrapper{
start: func(code bool, styleAttr string) string {
+ if code {
+ return fmt.Sprintf(`
`, styleAttr)
+ }
+
return fmt.Sprintf(``, styleAttr)
},
end: func(code bool) string {
- return "
"
+ if code {
+ return `
`
+ }
+
+ return ``
},
}
)
@@ -147,6 +162,7 @@ type Formatter struct {
allClasses bool
preWrapper PreWrapper
tabWidth int
+ wrapLongLines bool
lineNumbers bool
lineNumbersInTable bool
linkableLineNumbers bool
@@ -197,10 +213,10 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
if wrapInTable {
// List line numbers in its own
- fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.Background))
+ fmt.Fprintf(w, " \n", f.styleAttr(css, chroma.PreWrapper))
fmt.Fprintf(w, " ", f.styleAttr(css, chroma.LineTable))
fmt.Fprintf(w, "\n", f.styleAttr(css, chroma.LineTableTD))
- fmt.Fprintf(w, f.preWrapper.Start(false, f.styleAttr(css, chroma.Background)))
+ fmt.Fprintf(w, f.preWrapper.Start(false, f.styleAttr(css, chroma.PreWrapper)))
for index := range lines {
line := f.baseLineNumber + index
highlight, next := f.shouldHighlight(highlightIndex, line)
@@ -222,7 +238,7 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
fmt.Fprintf(w, " | \n", f.styleAttr(css, chroma.LineTableTD, "width:100%"))
}
- fmt.Fprintf(w, f.preWrapper.Start(true, f.styleAttr(css, chroma.Background)))
+ fmt.Fprintf(w, f.preWrapper.Start(true, f.styleAttr(css, chroma.PreWrapper)))
highlightIndex = 0
for index, tokens := range lines {
@@ -232,14 +248,28 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
if next {
highlightIndex++
}
+
+ // Start of Line
+ fmt.Fprint(w, `", f.styleAttr(css, chroma.LineHighlight))
+ // Line + LineHighlight
+ if f.Classes {
+ fmt.Fprintf(w, ` class="%s %s"`, f.class(chroma.Line), f.class(chroma.LineHighlight))
+ } else {
+ fmt.Fprintf(w, ` style="%s %s"`, css[chroma.Line], css[chroma.LineHighlight])
+ }
+ fmt.Fprint(w, `>`)
+ } else {
+ fmt.Fprintf(w, "%s>", f.styleAttr(css, chroma.Line))
}
+ // Line number
if f.lineNumbers && !wrapInTable {
fmt.Fprintf(w, "%s", f.styleAttr(css, chroma.LineNumbers), f.lineIDAttribute(line), f.lineTitleWithLinkIfNeeded(lineDigits, line))
}
+ fmt.Fprintf(w, ``, f.styleAttr(css, chroma.CodeLine))
+
for _, token := range tokens {
html := html.EscapeString(token.String())
attr := f.styleAttr(css, token.Type)
@@ -248,9 +278,10 @@ func (f *Formatter) writeHTML(w io.Writer, style *chroma.Style, tokens []chroma.
}
fmt.Fprint(w, html)
}
- if highlight {
- fmt.Fprintf(w, "")
- }
+
+ fmt.Fprint(w, ``) // End of CodeLine
+
+ fmt.Fprint(w, ``) // End of Line
}
fmt.Fprintf(w, f.preWrapper.End(true))
@@ -351,7 +382,11 @@ func (f *Formatter) tabWidthStyle() string {
func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error {
css := f.styleToCSS(style)
// Special-case background as it is mapped to the outer ".chroma" class.
- if _, err := fmt.Fprintf(w, "/* %s */ .%schroma { %s }\n", chroma.Background, f.prefix, css[chroma.Background]); err != nil {
+ if _, err := fmt.Fprintf(w, "/* %s */ .%sbg { %s }\n", chroma.Background, f.prefix, css[chroma.Background]); err != nil {
+ return err
+ }
+ // Special-case PreWrapper as it is the ".chroma" class.
+ if _, err := fmt.Fprintf(w, "/* %s */ .%schroma { %s }\n", chroma.PreWrapper, f.prefix, css[chroma.PreWrapper]); err != nil {
return err
}
// Special-case code column of table to expand width.
@@ -375,7 +410,8 @@ func (f *Formatter) WriteCSS(w io.Writer, style *chroma.Style) error {
sort.Ints(tts)
for _, ti := range tts {
tt := chroma.TokenType(ti)
- if tt == chroma.Background {
+ switch tt {
+ case chroma.Background, chroma.PreWrapper:
continue
}
class := f.class(tt)
@@ -405,12 +441,21 @@ func (f *Formatter) styleToCSS(style *chroma.Style) map[chroma.TokenType]string
classes[t] = StyleEntryToCSS(entry)
}
classes[chroma.Background] += f.tabWidthStyle()
- lineNumbersStyle := "margin-right: 0.4em; padding: 0 0.4em 0 0.4em;"
+ classes[chroma.PreWrapper] += classes[chroma.Background] + `;`
+ // Make PreWrapper a grid to show highlight style with full width.
+ if len(f.highlightRanges) > 0 {
+ classes[chroma.PreWrapper] += `display: grid;`
+ }
+ // Make PreWrapper wrap long lines.
+ if f.wrapLongLines {
+ classes[chroma.PreWrapper] += `white-space: pre-wrap; word-break: break-word;`
+ }
+ lineNumbersStyle := `white-space: pre; user-select: none; margin-right: 0.4em; padding: 0 0.4em 0 0.4em;`
// All rules begin with default rules followed by user provided rules
+ classes[chroma.Line] = `display: flex;` + classes[chroma.Line]
classes[chroma.LineNumbers] = lineNumbersStyle + classes[chroma.LineNumbers]
classes[chroma.LineNumbersTable] = lineNumbersStyle + classes[chroma.LineNumbersTable]
- classes[chroma.LineHighlight] = "display: block; width: 100%;" + classes[chroma.LineHighlight]
- classes[chroma.LineTable] = "border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block;" + classes[chroma.LineTable]
+ classes[chroma.LineTable] = "border-spacing: 0; padding: 0; margin: 0; border: 0;" + classes[chroma.LineTable]
classes[chroma.LineTableTD] = "vertical-align: top; padding: 0; margin: 0; border: 0;" + classes[chroma.LineTableTD]
return classes
}
diff --git a/vendor/github.com/alecthomas/chroma/go.mod b/vendor/github.com/alecthomas/chroma/go.mod
deleted file mode 100644
index c406562..0000000
--- a/vendor/github.com/alecthomas/chroma/go.mod
+++ /dev/null
@@ -1,9 +0,0 @@
-module github.com/alecthomas/chroma
-
-go 1.13
-
-require (
- github.com/davecgh/go-spew v1.1.1 // indirect
- github.com/dlclark/regexp2 v1.4.0
- github.com/stretchr/testify v1.7.0
-)
diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bashsession.go b/vendor/github.com/alecthomas/chroma/lexers/b/bashsession.go
index 9043fa1..055cbb3 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/b/bashsession.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/b/bashsession.go
@@ -20,7 +20,7 @@ var BashSession = internal.Register(MustNewLazyLexer(
func bashsessionRules() Rules {
return Rules{
"root": {
- {`(^[#$%>]\s*)(.*\n?)`, ByGroups(GenericPrompt, Using(Bash)), nil},
+ {`^((?:\[[^]]+@[^]]+\]\s?)?[#$%>])(\s*)(.*\n?)`, ByGroups(GenericPrompt, Text, Using(Bash)), nil},
{`^.+\n?`, GenericOutput, nil},
},
}
diff --git a/vendor/github.com/alecthomas/chroma/lexers/b/bicep.go b/vendor/github.com/alecthomas/chroma/lexers/b/bicep.go
new file mode 100644
index 0000000..ec136fb
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/b/bicep.go
@@ -0,0 +1,112 @@
+package b
+
+import (
+ "strings"
+
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// Bicep lexer.
+var Bicep = internal.Register(MustNewLazyLexer(
+ &Config{
+ Name: "Bicep",
+ Aliases: []string{"bicep"},
+ Filenames: []string{"*.bicep"},
+ },
+ bicepRules,
+))
+
+func bicepRules() Rules {
+ bicepFunctions := []string{
+ "any",
+ "array",
+ "concat",
+ "contains",
+ "empty",
+ "first",
+ "intersection",
+ "items",
+ "last",
+ "length",
+ "min",
+ "max",
+ "range",
+ "skip",
+ "take",
+ "union",
+ "dateTimeAdd",
+ "utcNow",
+ "deployment",
+ "environment",
+ "loadFileAsBase64",
+ "loadTextContent",
+ "int",
+ "json",
+ "extensionResourceId",
+ "getSecret",
+ "list",
+ "listKeys",
+ "listKeyValue",
+ "listAccountSas",
+ "listSecrets",
+ "pickZones",
+ "reference",
+ "resourceId",
+ "subscriptionResourceId",
+ "tenantResourceId",
+ "managementGroup",
+ "resourceGroup",
+ "subscription",
+ "tenant",
+ "base64",
+ "base64ToJson",
+ "base64ToString",
+ "dataUri",
+ "dataUriToString",
+ "endsWith",
+ "format",
+ "guid",
+ "indexOf",
+ "lastIndexOf",
+ "length",
+ "newGuid",
+ "padLeft",
+ "replace",
+ "split",
+ "startsWith",
+ "string",
+ "substring",
+ "toLower",
+ "toUpper",
+ "trim",
+ "uniqueString",
+ "uri",
+ "uriComponent",
+ "uriComponentToString",
+ }
+
+ return Rules{
+ "root": {
+ {`//[^\n\r]+`, CommentSingle, nil},
+ {`/\*.*?\*/`, CommentMultiline, nil},
+ {`([']?\w+[']?)(:)`, ByGroups(NameProperty, Punctuation), nil},
+ {`\b('(resourceGroup|subscription|managementGroup|tenant)')\b`, KeywordNamespace, nil},
+ {`'[\w\$\{\(\)\}\.]{1,}?'`, LiteralStringInterpol, nil},
+ {`('''|').*?('''|')`, LiteralString, nil},
+ {`\b(allowed|batchSize|description|maxLength|maxValue|metadata|minLength|minValue|secure)\b`, NameDecorator, nil},
+ {`\b(az|sys)\.`, NameNamespace, nil},
+ {`\b(` + strings.Join(bicepFunctions, "|") + `)\b`, NameFunction, nil},
+ // https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-functions-logical
+ {`\b(bool)(\()`, ByGroups(NameFunction, Punctuation), nil},
+ {`\b(for|if|in)\b`, Keyword, nil},
+ {`\b(module|output|param|resource|var)\b`, KeywordDeclaration, nil},
+ {`\b(array|bool|int|object|string)\b`, KeywordType, nil},
+ // https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/operators
+ {`(>=|>|<=|<|==|!=|=~|!~|::|&&|\?\?|!|-|%|\*|\/|\+)`, Operator, nil},
+ {`[\(\)\[\]\.:\?{}@=]`, Punctuation, nil},
+ {`[\w_-]+`, Text, nil},
+ {`\s+`, TextWhitespace, nil},
+ },
+ }
+}
diff --git a/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go b/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go
index 725bcb8..4776864 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/c/csharp.go
@@ -24,7 +24,8 @@ func cSharpRules() Rules {
{`^\s*\[.*?\]`, NameAttribute, nil},
{`[^\S\n]+`, Text, nil},
{`\\\n`, Text, nil},
- {`//.*?\n`, CommentSingle, nil},
+ {`///[^\n\r]+`, CommentSpecial, nil},
+ {`//[^\n\r]+`, CommentSingle, nil},
{`/[*].*?[*]/`, CommentMultiline, nil},
{`\n`, Text, nil},
{`[~!%^&*()+=|\[\]:;,.<>/?-]`, Punctuation, nil},
@@ -34,12 +35,12 @@ func cSharpRules() Rules {
{`"(\\\\|\\"|[^"\n])*["\n]`, LiteralString, nil},
{`'\\.'|'[^\\]'`, LiteralStringChar, nil},
{`0[xX][0-9a-fA-F]+[Ll]?|[0-9_](\.[0-9]*)?([eE][+-]?[0-9]+)?[flFLdD]?`, LiteralNumber, nil},
- {`#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma)\b.*?\n`, CommentPreproc, nil},
+ {`#[ \t]*(if|endif|else|elif|define|undef|line|error|warning|region|endregion|pragma|nullable)\b[^\n\r]+`, CommentPreproc, nil},
{`\b(extern)(\s+)(alias)\b`, ByGroups(Keyword, Text, Keyword), nil},
- {`(abstract|as|async|await|base|break|by|case|catch|checked|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|interface|internal|is|let|lock|new|null|on|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|true|try|typeof|unchecked|unsafe|virtual|void|while|get|set|new|partial|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b`, Keyword, nil},
+ {`(abstract|as|async|await|base|break|by|case|catch|checked|const|continue|default|delegate|do|else|enum|event|explicit|extern|false|finally|fixed|for|foreach|goto|if|implicit|in|init|internal|is|let|lock|new|null|on|operator|out|override|params|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|true|try|typeof|unchecked|unsafe|virtual|void|while|get|set|new|partial|yield|add|remove|value|alias|ascending|descending|from|group|into|orderby|select|thenby|where|join|equals)\b`, Keyword, nil},
{`(global)(::)`, ByGroups(Keyword, Punctuation), nil},
{`(bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\b\??`, KeywordType, nil},
- {`(class|struct)(\s+)`, ByGroups(Keyword, Text), Push("class")},
+ {`(class|struct|record|interface)(\s+)`, ByGroups(Keyword, Text), Push("class")},
{`(namespace|using)(\s+)`, ByGroups(Keyword, Text), Push("namespace")},
{`@?[_a-zA-Z]\w*`, Name, nil},
},
diff --git a/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go b/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go
index b6be884..deb182e 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/k/kotlin.go
@@ -18,7 +18,7 @@ var Kotlin = internal.Register(MustNewLazyLexer(
))
func kotlinRules() Rules {
- const kotlinIdentifier = "(?:[_\\p{L}][\\p{L}\\p{N}]*|`@?[_\\p{L}][\\p{L}\\p{N}]+)"
+ const kotlinIdentifier = "(?:[_\\p{L}][\\p{L}\\p{N}]*|`@?[_\\p{L}][\\p{L}\\p{N}]+`)"
return Rules{
"root": {
diff --git a/vendor/github.com/alecthomas/chroma/lexers/o/openedgeabl.go b/vendor/github.com/alecthomas/chroma/lexers/o/openedgeabl.go
new file mode 100644
index 0000000..5561971
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/o/openedgeabl.go
@@ -0,0 +1,50 @@
+package o
+
+import (
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// OpenedgeAbl lexer.
+var OpenEdgeABL = internal.Register(MustNewLazyLexer(
+ &Config{
+ Name: "OpenEdge ABL",
+ Aliases: []string{"openedge", "abl", "progress", "openedgeabl"},
+ Filenames: []string{"*.p", "*.cls", "*.w", "*.i"},
+ MimeTypes: []string{"text/x-openedge", "application/x-openedge"},
+ },
+ func() Rules {
+ return Rules{
+ "root": {
+ {`/\*`, CommentMultiline, Push("comment")},
+ {`//.*?$`, CommentSingle, nil},
+ {`\{`, CommentPreproc, Push("preprocessor")},
+ {`\s*&.*`, CommentPreproc, nil},
+ {`0[xX][0-9a-fA-F]+[LlUu]*`, LiteralNumberHex, nil},
+ {`(?i)(DEFINE|DEF|DEFI|DEFIN)\b`, KeywordDeclaration, nil},
+ {`(?i)(^|(?<=[^\w\-]))(CHARACTER|CHAR|CHARA|CHARAC|CHARACT|CHARACTE|COM-HANDLE|DATE|DATETIME|DATETIME-TZ|DECIMAL|DEC|DECI|DECIM|DECIMA|HANDLE|INT64|INTEGER|INT|INTE|INTEG|INTEGE|LOGICAL|LONGCHAR|MEMPTR|RAW|RECID|ROWID)\s*($|(?=[^\w\-]))`, KeywordType, nil},
+ {Words(`(?i)(^|(?<=[^\w\-]))`, `\s*($|(?=[^\w\-]))`, `ABS`, `ABSO`, `ABSOL`, `ABSOLU`, `ABSOLUT`, `ABSOLUTE`, `ABSTRACT`, `ACCELERATOR`, `ACCUM`, `ACCUMU`, `ACCUMUL`, `ACCUMULA`, `ACCUMULAT`, `ACCUMULATE`, `ACTIVE-FORM`, `ACTIVE-WINDOW`, `ADD`, `ADD-BUFFER`, `ADD-CALC-COLUMN`, `ADD-COLUMNS-FROM`, `ADD-EVENTS-PROCEDURE`, `ADD-FIELDS-FROM`, `ADD-FIRST`, `ADD-INDEX-FIELD`, `ADD-LAST`, `ADD-LIKE-COLUMN`, `ADD-LIKE-FIELD`, `ADD-LIKE-INDEX`, `ADD-NEW-FIELD`, `ADD-NEW-INDEX`, `ADD-SCHEMA-LOCATION`, `ADD-SUPER-PROCEDURE`, `ADM-DATA`, `ADVISE`, `ALERT-BOX`, `ALIAS`, `ALL`, `ALLOW-COLUMN-SEARCHING`, `ALLOW-REPLICATION`, `ALTER`, `ALWAYS-ON-TOP`, `AMBIG`, `AMBIGU`, `AMBIGUO`, `AMBIGUOU`, `AMBIGUOUS`, `ANALYZ`, `ANALYZE`, `AND`, `ANSI-ONLY`, `ANY`, `ANYWHERE`, `APPEND`, `APPL-ALERT`, `APPL-ALERT-`, `APPL-ALERT-B`, `APPL-ALERT-BO`, `APPL-ALERT-BOX`, `APPL-ALERT-BOXE`, `APPL-ALERT-BOXES`, `APPL-CONTEXT-ID`, `APPLICATION`, `APPLY`, `APPSERVER-INFO`, `APPSERVER-PASSWORD`, `APPSERVER-USERID`, `ARRAY-MESSAGE`, `AS`, `ASC`, `ASCE`, `ASCEN`, `ASCEND`, `ASCENDI`, `ASCENDIN`, `ASCENDING`, `ASK-OVERWRITE`, `ASSEMBLY`, `ASSIGN`, `ASYNC-REQUEST-COUNT`, `ASYNC-REQUEST-HANDLE`, `ASYNCHRONOUS`, `AT`, `ATTACHED-PAIRLIST`, `ATTR`, `ATTR-SPACE`, `ATTRI`, `ATTRIB`, `ATTRIBU`, `ATTRIBUT`, `AUDIT-CONTROL`, `AUDIT-ENABLED`, `AUDIT-EVENT-CONTEXT`, `AUDIT-POLICY`, `AUTHENTICATION-FAILED`, `AUTHORIZATION`, `AUTO-COMP`, `AUTO-COMPL`, `AUTO-COMPLE`, `AUTO-COMPLET`, `AUTO-COMPLETI`, `AUTO-COMPLETIO`, `AUTO-COMPLETION`, `AUTO-END-KEY`, `AUTO-ENDKEY`, `AUTO-GO`, `AUTO-IND`, `AUTO-INDE`, `AUTO-INDEN`, `AUTO-INDENT`, `AUTO-RESIZE`, `AUTO-RET`, `AUTO-RETU`, `AUTO-RETUR`, `AUTO-RETURN`, `AUTO-SYNCHRONIZE`, `AUTO-Z`, `AUTO-ZA`, `AUTO-ZAP`, `AUTOMATIC`, `AVAIL`, `AVAILA`, `AVAILAB`, `AVAILABL`, `AVAILABLE`, `AVAILABLE-FORMATS`, `AVE`, `AVER`, `AVERA`, `AVERAG`, `AVERAGE`, `AVG`, `BACK`, `BACKG`, `BACKGR`, `BACKGRO`, `BACKGROU`, `BACKGROUN`, `BACKGROUND`, `BACKWARD`, `BACKWARDS`, `BASE64-DECODE`, `BASE64-ENCODE`, `BASE-ADE`, `BASE-KEY`, `BATCH`, `BATCH-`, `BATCH-M`, `BATCH-MO`, `BATCH-MOD`, `BATCH-MODE`, `BATCH-SIZE`, `BEFORE-H`, `BEFORE-HI`, `BEFORE-HID`, `BEFORE-HIDE`, `BEGIN-EVENT-GROUP`, `BEGINS`, `BELL`, `BETWEEN`, `BGC`, `BGCO`, `BGCOL`, `BGCOLO`, `BGCOLOR`, `BIG-ENDIAN`, `BINARY`, `BIND`, `BIND-WHERE`, `BLANK`, `BLOCK-ITERATION-DISPLAY`, `BLOCK-LEVEL`, `BORDER-B`, `BORDER-BO`, `BORDER-BOT`, `BORDER-BOTT`, `BORDER-BOTTO`, `BORDER-BOTTOM-CHARS`, `BORDER-BOTTOM-P`, `BORDER-BOTTOM-PI`, `BORDER-BOTTOM-PIX`, `BORDER-BOTTOM-PIXE`, `BORDER-BOTTOM-PIXEL`, `BORDER-BOTTOM-PIXELS`, `BORDER-L`, `BORDER-LE`, `BORDER-LEF`, `BORDER-LEFT`, `BORDER-LEFT-`, `BORDER-LEFT-C`, `BORDER-LEFT-CH`, `BORDER-LEFT-CHA`, `BORDER-LEFT-CHAR`, `BORDER-LEFT-CHARS`, `BORDER-LEFT-P`, `BORDER-LEFT-PI`, `BORDER-LEFT-PIX`, `BORDER-LEFT-PIXE`, `BORDER-LEFT-PIXEL`, `BORDER-LEFT-PIXELS`, `BORDER-R`, `BORDER-RI`, `BORDER-RIG`, `BORDER-RIGH`, `BORDER-RIGHT`, `BORDER-RIGHT-`, `BORDER-RIGHT-C`, `BORDER-RIGHT-CH`, `BORDER-RIGHT-CHA`, `BORDER-RIGHT-CHAR`, `BORDER-RIGHT-CHARS`, `BORDER-RIGHT-P`, `BORDER-RIGHT-PI`, `BORDER-RIGHT-PIX`, `BORDER-RIGHT-PIXE`, `BORDER-RIGHT-PIXEL`, `BORDER-RIGHT-PIXELS`, `BORDER-T`, `BORDER-TO`, `BORDER-TOP`, `BORDER-TOP-`, `BORDER-TOP-C`, `BORDER-TOP-CH`, `BORDER-TOP-CHA`, `BORDER-TOP-CHAR`, `BORDER-TOP-CHARS`, `BORDER-TOP-P`, `BORDER-TOP-PI`, `BORDER-TOP-PIX`, `BORDER-TOP-PIXE`, `BORDER-TOP-PIXEL`, `BORDER-TOP-PIXELS`, `BOX`, `BOX-SELECT`, `BOX-SELECTA`, `BOX-SELECTAB`, `BOX-SELECTABL`, `BOX-SELECTABLE`, `BREAK`, `BROWSE`, `BUFFER`, `BUFFER-CHARS`, `BUFFER-COMPARE`, `BUFFER-COPY`, `BUFFER-CREATE`, `BUFFER-DELETE`, `BUFFER-FIELD`, `BUFFER-HANDLE`, `BUFFER-LINES`, `BUFFER-NAME`, `BUFFER-PARTITION-ID`, `BUFFER-RELEASE`, `BUFFER-VALUE`, `BUTTON`, `BUTTONS`, `BY`, `BY-POINTER`, `BY-VARIANT-POINTER`, `CACHE`, `CACHE-SIZE`, `CALL`, `CALL-NAME`, `CALL-TYPE`, `CAN-CREATE`, `CAN-DELETE`, `CAN-DO`, `CAN-DO-DOMAIN-SUPPORT`, `CAN-FIND`, `CAN-QUERY`, `CAN-READ`, `CAN-SET`, `CAN-WRITE`, `CANCEL-BREAK`, `CANCEL-BUTTON`, `CAPS`, `CAREFUL-PAINT`, `CASE`, `CASE-SEN`, `CASE-SENS`, `CASE-SENSI`, `CASE-SENSIT`, `CASE-SENSITI`, `CASE-SENSITIV`, `CASE-SENSITIVE`, `CAST`, `CATCH`, `CDECL`, `CENTER`, `CENTERE`, `CENTERED`, `CHAINED`, `CHARACTER`, `CHARACTER_LENGTH`, `CHARSET`, `CHECK`, `CHECKED`, `CHOOSE`, `CHR`, `CLASS`, `CLASS-TYPE`, `CLEAR`, `CLEAR-APPL-CONTEXT`, `CLEAR-LOG`, `CLEAR-SELECT`, `CLEAR-SELECTI`, `CLEAR-SELECTIO`, `CLEAR-SELECTION`, `CLEAR-SORT-ARROW`, `CLEAR-SORT-ARROWS`, `CLIENT-CONNECTION-ID`, `CLIENT-PRINCIPAL`, `CLIENT-TTY`, `CLIENT-TYPE`, `CLIENT-WORKSTATION`, `CLIPBOARD`, `CLOSE`, `CLOSE-LOG`, `CODE`, `CODEBASE-LOCATOR`, `CODEPAGE`, `CODEPAGE-CONVERT`, `COL`, `COL-OF`, `COLLATE`, `COLON`, `COLON-ALIGN`, `COLON-ALIGNE`, `COLON-ALIGNED`, `COLOR`, `COLOR-TABLE`, `COLU`, `COLUM`, `COLUMN`, `COLUMN-BGCOLOR`, `COLUMN-DCOLOR`, `COLUMN-FGCOLOR`, `COLUMN-FONT`, `COLUMN-LAB`, `COLUMN-LABE`, `COLUMN-LABEL`, `COLUMN-MOVABLE`, `COLUMN-OF`, `COLUMN-PFCOLOR`, `COLUMN-READ-ONLY`, `COLUMN-RESIZABLE`, `COLUMN-SCROLLING`, `COLUMNS`, `COM-HANDLE`, `COM-SELF`, `COMBO-BOX`, `COMMAND`, `COMPARES`, `COMPILE`, `COMPILER`, `COMPLETE`, `CONFIG-NAME`, `CONNECT`, `CONNECTED`, `CONSTRUCTOR`, `CONTAINS`, `CONTENTS`, `CONTEXT`, `CONTEXT-HELP`, `CONTEXT-HELP-FILE`, `CONTEXT-HELP-ID`, `CONTEXT-POPUP`, `CONTROL`, `CONTROL-BOX`, `CONTROL-FRAME`, `CONVERT`, `CONVERT-3D-COLORS`, `CONVERT-TO-OFFS`, `CONVERT-TO-OFFSE`, `CONVERT-TO-OFFSET`, `COPY-DATASET`, `COPY-LOB`, `COPY-SAX-ATTRIBUTES`, `COPY-TEMP-TABLE`, `COUNT`, `COUNT-OF`, `CPCASE`, `CPCOLL`, `CPINTERNAL`, `CPLOG`, `CPPRINT`, `CPRCODEIN`, `CPRCODEOUT`, `CPSTREAM`, `CPTERM`, `CRC-VALUE`, `CREATE`, `CREATE-LIKE`, `CREATE-LIKE-SEQUENTIAL`, `CREATE-NODE-NAMESPACE`, `CREATE-RESULT-LIST-ENTRY`, `CREATE-TEST-FILE`, `CURRENT`, `CURRENT-CHANGED`, `CURRENT-COLUMN`, `CURRENT-ENV`, `CURRENT-ENVI`, `CURRENT-ENVIR`, `CURRENT-ENVIRO`, `CURRENT-ENVIRON`, `CURRENT-ENVIRONM`, `CURRENT-ENVIRONME`, `CURRENT-ENVIRONMEN`, `CURRENT-ENVIRONMENT`, `CURRENT-ITERATION`, `CURRENT-LANG`, `CURRENT-LANGU`, `CURRENT-LANGUA`, `CURRENT-LANGUAG`, `CURRENT-LANGUAGE`, `CURRENT-QUERY`, `CURRENT-REQUEST-INFO`, `CURRENT-RESPONSE-INFO`, `CURRENT-RESULT-ROW`, `CURRENT-ROW-MODIFIED`, `CURRENT-VALUE`, `CURRENT-WINDOW`, `CURRENT_DATE`, `CURS`, `CURSO`, `CURSOR`, `CURSOR-CHAR`, `CURSOR-LINE`, `CURSOR-OFFSET`, `DATA-BIND`, `DATA-ENTRY-RET`, `DATA-ENTRY-RETU`, `DATA-ENTRY-RETUR`, `DATA-ENTRY-RETURN`, `DATA-REL`, `DATA-RELA`, `DATA-RELAT`, `DATA-RELATI`, `DATA-RELATIO`, `DATA-RELATION`, `DATA-SOURCE`, `DATA-SOURCE-COMPLETE-MAP`, `DATA-SOURCE-MODIFIED`, `DATA-SOURCE-ROWID`, `DATA-T`, `DATA-TY`, `DATA-TYP`, `DATA-TYPE`, `DATABASE`, `DATASERVERS`, `DATASET`, `DATASET-HANDLE`, `DATE`, `DATE-F`, `DATE-FO`, `DATE-FOR`, `DATE-FORM`, `DATE-FORMA`, `DATE-FORMAT`, `DAY`, `DB-CONTEXT`, `DB-REFERENCES`, `DBCODEPAGE`, `DBCOLLATION`, `DBNAME`, `DBPARAM`, `DBREST`, `DBRESTR`, `DBRESTRI`, `DBRESTRIC`, `DBRESTRICT`, `DBRESTRICTI`, `DBRESTRICTIO`, `DBRESTRICTION`, `DBRESTRICTIONS`, `DBTASKID`, `DBTYPE`, `DBVERS`, `DBVERSI`, `DBVERSIO`, `DBVERSION`, `DCOLOR`, `DDE`, `DDE-ERROR`, `DDE-I`, `DDE-ID`, `DDE-ITEM`, `DDE-NAME`, `DDE-TOPIC`, `DEBLANK`, `DEBU`, `DEBUG`, `DEBUG-ALERT`, `DEBUG-LIST`, `DEBUGGER`, `DECIMAL`, `DECIMALS`, `DECLARE`, `DECLARE-NAMESPACE`, `DECRYPT`, `DEFAULT`, `DEFAULT-B`, `DEFAULT-BU`, `DEFAULT-BUFFER-HANDLE`, `DEFAULT-BUT`, `DEFAULT-BUTT`, `DEFAULT-BUTTO`, `DEFAULT-BUTTON`, `DEFAULT-COMMIT`, `DEFAULT-EX`, `DEFAULT-EXT`, `DEFAULT-EXTE`, `DEFAULT-EXTEN`, `DEFAULT-EXTENS`, `DEFAULT-EXTENSI`, `DEFAULT-EXTENSIO`, `DEFAULT-EXTENSION`, `DEFAULT-NOXL`, `DEFAULT-NOXLA`, `DEFAULT-NOXLAT`, `DEFAULT-NOXLATE`, `DEFAULT-VALUE`, `DEFAULT-WINDOW`, `DEFINE`, `DEFINE-USER-EVENT-MANAGER`, `DEFINED`, `DEL`, `DELE`, `DELEGATE`, `DELET`, `DELETE PROCEDURE`, `DELETE`, `DELETE-CHAR`, `DELETE-CHARA`, `DELETE-CHARAC`, `DELETE-CHARACT`, `DELETE-CHARACTE`, `DELETE-CHARACTER`, `DELETE-CURRENT-ROW`, `DELETE-LINE`, `DELETE-RESULT-LIST-ENTRY`, `DELETE-SELECTED-ROW`, `DELETE-SELECTED-ROWS`, `DELIMITER`, `DESC`, `DESCE`, `DESCEN`, `DESCEND`, `DESCENDI`, `DESCENDIN`, `DESCENDING`, `DESELECT-FOCUSED-ROW`, `DESELECT-ROWS`, `DESELECT-SELECTED-ROW`, `DESELECTION`, `DESTRUCTOR`, `DIALOG-BOX`, `DICT`, `DICTI`, `DICTIO`, `DICTION`, `DICTIONA`, `DICTIONAR`, `DICTIONARY`, `DIR`, `DISABLE`, `DISABLE-AUTO-ZAP`, `DISABLE-DUMP-TRIGGERS`, `DISABLE-LOAD-TRIGGERS`, `DISABLED`, `DISCON`, `DISCONN`, `DISCONNE`, `DISCONNEC`, `DISCONNECT`, `DISP`, `DISPL`, `DISPLA`, `DISPLAY`, `DISPLAY-MESSAGE`, `DISPLAY-T`, `DISPLAY-TY`, `DISPLAY-TYP`, `DISPLAY-TYPE`, `DISTINCT`, `DO`, `DOMAIN-DESCRIPTION`, `DOMAIN-NAME`, `DOMAIN-TYPE`, `DOS`, `DOUBLE`, `DOWN`, `DRAG-ENABLED`, `DROP`, `DROP-DOWN`, `DROP-DOWN-LIST`, `DROP-FILE-NOTIFY`, `DROP-TARGET`, `DS-CLOSE-CURSOR`, `DSLOG-MANAGER`, `DUMP`, `DYNAMIC`, `DYNAMIC-ENUM`, `DYNAMIC-FUNCTION`, `DYNAMIC-INVOKE`, `EACH`, `ECHO`, `EDGE`, `EDGE-`, `EDGE-C`, `EDGE-CH`, `EDGE-CHA`, `EDGE-CHAR`, `EDGE-CHARS`, `EDGE-P`, `EDGE-PI`, `EDGE-PIX`, `EDGE-PIXE`, `EDGE-PIXEL`, `EDGE-PIXELS`, `EDIT-CAN-PASTE`, `EDIT-CAN-UNDO`, `EDIT-CLEAR`, `EDIT-COPY`, `EDIT-CUT`, `EDIT-PASTE`, `EDIT-UNDO`, `EDITING`, `EDITOR`, `ELSE`, `EMPTY`, `EMPTY-TEMP-TABLE`, `ENABLE`, `ENABLED-FIELDS`, `ENCODE`, `ENCRYPT`, `ENCRYPT-AUDIT-MAC-KEY`, `ENCRYPTION-SALT`, `END`, `END-DOCUMENT`, `END-ELEMENT`, `END-EVENT-GROUP`, `END-FILE-DROP`, `END-KEY`, `END-MOVE`, `END-RESIZE`, `END-ROW-RESIZE`, `END-USER-PROMPT`, `ENDKEY`, `ENTERED`, `ENTITY-EXPANSION-LIMIT`, `ENTRY`, `ENUM`, `EQ`, `ERROR`, `ERROR-COL`, `ERROR-COLU`, `ERROR-COLUM`, `ERROR-COLUMN`, `ERROR-ROW`, `ERROR-STACK-TRACE`, `ERROR-STAT`, `ERROR-STATU`, `ERROR-STATUS`, `ESCAPE`, `ETIME`, `EVENT`, `EVENT-GROUP-ID`, `EVENT-PROCEDURE`, `EVENT-PROCEDURE-CONTEXT`, `EVENT-T`, `EVENT-TY`, `EVENT-TYP`, `EVENT-TYPE`, `EVENTS`, `EXCEPT`, `EXCLUSIVE`, `EXCLUSIVE-`, `EXCLUSIVE-ID`, `EXCLUSIVE-L`, `EXCLUSIVE-LO`, `EXCLUSIVE-LOC`, `EXCLUSIVE-LOCK`, `EXCLUSIVE-WEB-USER`, `EXECUTE`, `EXISTS`, `EXP`, `EXPAND`, `EXPANDABLE`, `EXPLICIT`, `EXPORT`, `EXPORT-PRINCIPAL`, `EXTENDED`, `EXTENT`, `EXTERNAL`, `FALSE`, `FETCH`, `FETCH-SELECTED-ROW`, `FGC`, `FGCO`, `FGCOL`, `FGCOLO`, `FGCOLOR`, `FIELD`, `FIELDS`, `FILE`, `FILE-CREATE-DATE`, `FILE-CREATE-TIME`, `FILE-INFO`, `FILE-INFOR`, `FILE-INFORM`, `FILE-INFORMA`, `FILE-INFORMAT`, `FILE-INFORMATI`, `FILE-INFORMATIO`, `FILE-INFORMATION`, `FILE-MOD-DATE`, `FILE-MOD-TIME`, `FILE-NAME`, `FILE-OFF`, `FILE-OFFS`, `FILE-OFFSE`, `FILE-OFFSET`, `FILE-SIZE`, `FILE-TYPE`, `FILENAME`, `FILL`, `FILL-IN`, `FILLED`, `FILTERS`, `FINAL`, `FINALLY`, `FIND`, `FIND-BY-ROWID`, `FIND-CASE-SENSITIVE`, `FIND-CURRENT`, `FIND-FIRST`, `FIND-GLOBAL`, `FIND-LAST`, `FIND-NEXT-OCCURRENCE`, `FIND-PREV-OCCURRENCE`, `FIND-SELECT`, `FIND-UNIQUE`, `FIND-WRAP-AROUND`, `FINDER`, `FIRST`, `FIRST-ASYNCH-REQUEST`, `FIRST-CHILD`, `FIRST-COLUMN`, `FIRST-FORM`, `FIRST-OBJECT`, `FIRST-OF`, `FIRST-PROC`, `FIRST-PROCE`, `FIRST-PROCED`, `FIRST-PROCEDU`, `FIRST-PROCEDUR`, `FIRST-PROCEDURE`, `FIRST-SERVER`, `FIRST-TAB-I`, `FIRST-TAB-IT`, `FIRST-TAB-ITE`, `FIRST-TAB-ITEM`, `FIT-LAST-COLUMN`, `FIXED-ONLY`, `FLAT-BUTTON`, `FLOAT`, `FOCUS`, `FOCUSED-ROW`, `FOCUSED-ROW-SELECTED`, `FONT`, `FONT-TABLE`, `FOR`, `FORCE-FILE`, `FORE`, `FOREG`, `FOREGR`, `FOREGRO`, `FOREGROU`, `FOREGROUN`, `FOREGROUND`, `FORM INPUT`, `FORM`, `FORM-LONG-INPUT`, `FORMA`, `FORMAT`, `FORMATTE`, `FORMATTED`, `FORWARD`, `FORWARDS`, `FRAGMEN`, `FRAGMENT`, `FRAM`, `FRAME`, `FRAME-COL`, `FRAME-DB`, `FRAME-DOWN`, `FRAME-FIELD`, `FRAME-FILE`, `FRAME-INDE`, `FRAME-INDEX`, `FRAME-LINE`, `FRAME-NAME`, `FRAME-ROW`, `FRAME-SPA`, `FRAME-SPAC`, `FRAME-SPACI`, `FRAME-SPACIN`, `FRAME-SPACING`, `FRAME-VAL`, `FRAME-VALU`, `FRAME-VALUE`, `FRAME-X`, `FRAME-Y`, `FREQUENCY`, `FROM`, `FROM-C`, `FROM-CH`, `FROM-CHA`, `FROM-CHAR`, `FROM-CHARS`, `FROM-CUR`, `FROM-CURR`, `FROM-CURRE`, `FROM-CURREN`, `FROM-CURRENT`, `FROM-P`, `FROM-PI`, `FROM-PIX`, `FROM-PIXE`, `FROM-PIXEL`, `FROM-PIXELS`, `FULL-HEIGHT`, `FULL-HEIGHT-`, `FULL-HEIGHT-C`, `FULL-HEIGHT-CH`, `FULL-HEIGHT-CHA`, `FULL-HEIGHT-CHAR`, `FULL-HEIGHT-CHARS`, `FULL-HEIGHT-P`, `FULL-HEIGHT-PI`, `FULL-HEIGHT-PIX`, `FULL-HEIGHT-PIXE`, `FULL-HEIGHT-PIXEL`, `FULL-HEIGHT-PIXELS`, `FULL-PATHN`, `FULL-PATHNA`, `FULL-PATHNAM`, `FULL-PATHNAME`, `FULL-WIDTH`, `FULL-WIDTH-`, `FULL-WIDTH-C`, `FULL-WIDTH-CH`, `FULL-WIDTH-CHA`, `FULL-WIDTH-CHAR`, `FULL-WIDTH-CHARS`, `FULL-WIDTH-P`, `FULL-WIDTH-PI`, `FULL-WIDTH-PIX`, `FULL-WIDTH-PIXE`, `FULL-WIDTH-PIXEL`, `FULL-WIDTH-PIXELS`, `FUNCTION`, `FUNCTION-CALL-TYPE`, `GATEWAY`, `GATEWAYS`, `GE`, `GENERATE-MD5`, `GENERATE-PBE-KEY`, `GENERATE-PBE-SALT`, `GENERATE-RANDOM-KEY`, `GENERATE-UUID`, `GET`, `GET-ATTR-CALL-TYPE`, `GET-ATTRIBUTE-NODE`, `GET-BINARY-DATA`, `GET-BLUE`, `GET-BLUE-`, `GET-BLUE-V`, `GET-BLUE-VA`, `GET-BLUE-VAL`, `GET-BLUE-VALU`, `GET-BLUE-VALUE`, `GET-BROWSE-COLUMN`, `GET-BUFFER-HANDLE`, `GET-BYTE`, `GET-CALLBACK-PROC-CONTEXT`, `GET-CALLBACK-PROC-NAME`, `GET-CGI-LIST`, `GET-CGI-LONG-VALUE`, `GET-CGI-VALUE`, `GET-CLASS`, `GET-CODEPAGES`, `GET-COLLATIONS`, `GET-CONFIG-VALUE`, `GET-CURRENT`, `GET-DOUBLE`, `GET-DROPPED-FILE`, `GET-DYNAMIC`, `GET-ERROR-COLUMN`, `GET-ERROR-ROW`, `GET-FILE`, `GET-FILE-NAME`, `GET-FILE-OFFSE`, `GET-FILE-OFFSET`, `GET-FIRST`, `GET-FLOAT`, `GET-GREEN`, `GET-GREEN-`, `GET-GREEN-V`, `GET-GREEN-VA`, `GET-GREEN-VAL`, `GET-GREEN-VALU`, `GET-GREEN-VALUE`, `GET-INDEX-BY-NAMESPACE-NAME`, `GET-INDEX-BY-QNAME`, `GET-INT64`, `GET-ITERATION`, `GET-KEY-VAL`, `GET-KEY-VALU`, `GET-KEY-VALUE`, `GET-LAST`, `GET-LOCALNAME-BY-INDEX`, `GET-LONG`, `GET-MESSAGE`, `GET-NEXT`, `GET-NUMBER`, `GET-POINTER-VALUE`, `GET-PREV`, `GET-PRINTERS`, `GET-PROPERTY`, `GET-QNAME-BY-INDEX`, `GET-RED`, `GET-RED-`, `GET-RED-V`, `GET-RED-VA`, `GET-RED-VAL`, `GET-RED-VALU`, `GET-RED-VALUE`, `GET-REPOSITIONED-ROW`, `GET-RGB-VALUE`, `GET-SELECTED`, `GET-SELECTED-`, `GET-SELECTED-W`, `GET-SELECTED-WI`, `GET-SELECTED-WID`, `GET-SELECTED-WIDG`, `GET-SELECTED-WIDGE`, `GET-SELECTED-WIDGET`, `GET-SHORT`, `GET-SIGNATURE`, `GET-SIZE`, `GET-STRING`, `GET-TAB-ITEM`, `GET-TEXT-HEIGHT`, `GET-TEXT-HEIGHT-`, `GET-TEXT-HEIGHT-C`, `GET-TEXT-HEIGHT-CH`, `GET-TEXT-HEIGHT-CHA`, `GET-TEXT-HEIGHT-CHAR`, `GET-TEXT-HEIGHT-CHARS`, `GET-TEXT-HEIGHT-P`, `GET-TEXT-HEIGHT-PI`, `GET-TEXT-HEIGHT-PIX`, `GET-TEXT-HEIGHT-PIXE`, `GET-TEXT-HEIGHT-PIXEL`, `GET-TEXT-HEIGHT-PIXELS`, `GET-TEXT-WIDTH`, `GET-TEXT-WIDTH-`, `GET-TEXT-WIDTH-C`, `GET-TEXT-WIDTH-CH`, `GET-TEXT-WIDTH-CHA`, `GET-TEXT-WIDTH-CHAR`, `GET-TEXT-WIDTH-CHARS`, `GET-TEXT-WIDTH-P`, `GET-TEXT-WIDTH-PI`, `GET-TEXT-WIDTH-PIX`, `GET-TEXT-WIDTH-PIXE`, `GET-TEXT-WIDTH-PIXEL`, `GET-TEXT-WIDTH-PIXELS`, `GET-TYPE-BY-INDEX`, `GET-TYPE-BY-NAMESPACE-NAME`, `GET-TYPE-BY-QNAME`, `GET-UNSIGNED-LONG`, `GET-UNSIGNED-SHORT`, `GET-URI-BY-INDEX`, `GET-VALUE-BY-INDEX`, `GET-VALUE-BY-NAMESPACE-NAME`, `GET-VALUE-BY-QNAME`, `GET-WAIT-STATE`, `GETBYTE`, `GLOBAL`, `GO-ON`, `GO-PEND`, `GO-PENDI`, `GO-PENDIN`, `GO-PENDING`, `GRANT`, `GRAPHIC-E`, `GRAPHIC-ED`, `GRAPHIC-EDG`, `GRAPHIC-EDGE`, `GRID-FACTOR-H`, `GRID-FACTOR-HO`, `GRID-FACTOR-HOR`, `GRID-FACTOR-HORI`, `GRID-FACTOR-HORIZ`, `GRID-FACTOR-HORIZO`, `GRID-FACTOR-HORIZON`, `GRID-FACTOR-HORIZONT`, `GRID-FACTOR-HORIZONTA`, `GRID-FACTOR-HORIZONTAL`, `GRID-FACTOR-V`, `GRID-FACTOR-VE`, `GRID-FACTOR-VER`, `GRID-FACTOR-VERT`, `GRID-FACTOR-VERTI`, `GRID-FACTOR-VERTIC`, `GRID-FACTOR-VERTICA`, `GRID-FACTOR-VERTICAL`, `GRID-SNAP`, `GRID-UNIT-HEIGHT`, `GRID-UNIT-HEIGHT-`, `GRID-UNIT-HEIGHT-C`, `GRID-UNIT-HEIGHT-CH`, `GRID-UNIT-HEIGHT-CHA`, `GRID-UNIT-HEIGHT-CHARS`, `GRID-UNIT-HEIGHT-P`, `GRID-UNIT-HEIGHT-PI`, `GRID-UNIT-HEIGHT-PIX`, `GRID-UNIT-HEIGHT-PIXE`, `GRID-UNIT-HEIGHT-PIXEL`, `GRID-UNIT-HEIGHT-PIXELS`, `GRID-UNIT-WIDTH`, `GRID-UNIT-WIDTH-`, `GRID-UNIT-WIDTH-C`, `GRID-UNIT-WIDTH-CH`, `GRID-UNIT-WIDTH-CHA`, `GRID-UNIT-WIDTH-CHAR`, `GRID-UNIT-WIDTH-CHARS`, `GRID-UNIT-WIDTH-P`, `GRID-UNIT-WIDTH-PI`, `GRID-UNIT-WIDTH-PIX`, `GRID-UNIT-WIDTH-PIXE`, `GRID-UNIT-WIDTH-PIXEL`, `GRID-UNIT-WIDTH-PIXELS`, `GRID-VISIBLE`, `GROUP`, `GT`, `GUID`, `HANDLE`, `HANDLER`, `HAS-RECORDS`, `HAVING`, `HEADER`, `HEIGHT`, `HEIGHT-`, `HEIGHT-C`, `HEIGHT-CH`, `HEIGHT-CHA`, `HEIGHT-CHAR`, `HEIGHT-CHARS`, `HEIGHT-P`, `HEIGHT-PI`, `HEIGHT-PIX`, `HEIGHT-PIXE`, `HEIGHT-PIXEL`, `HEIGHT-PIXELS`, `HELP`, `HEX-DECODE`, `HEX-ENCODE`, `HIDDEN`, `HIDE`, `HORI`, `HORIZ`, `HORIZO`, `HORIZON`, `HORIZONT`, `HORIZONTA`, `HORIZONTAL`, `HOST-BYTE-ORDER`, `HTML-CHARSET`, `HTML-END-OF-LINE`, `HTML-END-OF-PAGE`, `HTML-FRAME-BEGIN`, `HTML-FRAME-END`, `HTML-HEADER-BEGIN`, `HTML-HEADER-END`, `HTML-TITLE-BEGIN`, `HTML-TITLE-END`, `HWND`, `ICON`, `IF`, `IMAGE`, `IMAGE-DOWN`, `IMAGE-INSENSITIVE`, `IMAGE-SIZE`, `IMAGE-SIZE-C`, `IMAGE-SIZE-CH`, `IMAGE-SIZE-CHA`, `IMAGE-SIZE-CHAR`, `IMAGE-SIZE-CHARS`, `IMAGE-SIZE-P`, `IMAGE-SIZE-PI`, `IMAGE-SIZE-PIX`, `IMAGE-SIZE-PIXE`, `IMAGE-SIZE-PIXEL`, `IMAGE-SIZE-PIXELS`, `IMAGE-UP`, `IMMEDIATE-DISPLAY`, `IMPLEMENTS`, `IMPORT`, `IMPORT-PRINCIPAL`, `IN`, `IN-HANDLE`, `INCREMENT-EXCLUSIVE-ID`, `INDEX`, `INDEX-HINT`, `INDEX-INFORMATION`, `INDEXED-REPOSITION`, `INDICATOR`, `INFO`, `INFOR`, `INFORM`, `INFORMA`, `INFORMAT`, `INFORMATI`, `INFORMATIO`, `INFORMATION`, `INHERIT-BGC`, `INHERIT-BGCO`, `INHERIT-BGCOL`, `INHERIT-BGCOLO`, `INHERIT-BGCOLOR`, `INHERIT-FGC`, `INHERIT-FGCO`, `INHERIT-FGCOL`, `INHERIT-FGCOLO`, `INHERIT-FGCOLOR`, `INHERITS`, `INIT`, `INITI`, `INITIA`, `INITIAL`, `INITIAL-DIR`, `INITIAL-FILTER`, `INITIALIZE-DOCUMENT-TYPE`, `INITIATE`, `INNER-CHARS`, `INNER-LINES`, `INPUT`, `INPUT-O`, `INPUT-OU`, `INPUT-OUT`, `INPUT-OUTP`, `INPUT-OUTPU`, `INPUT-OUTPUT`, `INPUT-VALUE`, `INSERT`, `INSERT-ATTRIBUTE`, `INSERT-B`, `INSERT-BA`, `INSERT-BAC`, `INSERT-BACK`, `INSERT-BACKT`, `INSERT-BACKTA`, `INSERT-BACKTAB`, `INSERT-FILE`, `INSERT-ROW`, `INSERT-STRING`, `INSERT-T`, `INSERT-TA`, `INSERT-TAB`, `INT64`, `INT`, `INTEGER`, `INTERFACE`, `INTERNAL-ENTRIES`, `INTO`, `INVOKE`, `IS`, `IS-ATTR`, `IS-ATTR-`, `IS-ATTR-S`, `IS-ATTR-SP`, `IS-ATTR-SPA`, `IS-ATTR-SPAC`, `IS-ATTR-SPACE`, `IS-CLASS`, `IS-JSON`, `IS-LEAD-BYTE`, `IS-OPEN`, `IS-PARAMETER-SET`, `IS-PARTITIONED`, `IS-ROW-SELECTED`, `IS-SELECTED`, `IS-XML`, `ITEM`, `ITEMS-PER-ROW`, `JOIN`, `JOIN-BY-SQLDB`, `KBLABEL`, `KEEP-CONNECTION-OPEN`, `KEEP-FRAME-Z`, `KEEP-FRAME-Z-`, `KEEP-FRAME-Z-O`, `KEEP-FRAME-Z-OR`, `KEEP-FRAME-Z-ORD`, `KEEP-FRAME-Z-ORDE`, `KEEP-FRAME-Z-ORDER`, `KEEP-MESSAGES`, `KEEP-SECURITY-CACHE`, `KEEP-TAB-ORDER`, `KEY`, `KEY-CODE`, `KEY-FUNC`, `KEY-FUNCT`, `KEY-FUNCTI`, `KEY-FUNCTIO`, `KEY-FUNCTION`, `KEY-LABEL`, `KEYCODE`, `KEYFUNC`, `KEYFUNCT`, `KEYFUNCTI`, `KEYFUNCTIO`, `KEYFUNCTION`, `KEYLABEL`, `KEYS`, `KEYWORD`, `KEYWORD-ALL`, `LABEL`, `LABEL-BGC`, `LABEL-BGCO`, `LABEL-BGCOL`, `LABEL-BGCOLO`, `LABEL-BGCOLOR`, `LABEL-DC`, `LABEL-DCO`, `LABEL-DCOL`, `LABEL-DCOLO`, `LABEL-DCOLOR`, `LABEL-FGC`, `LABEL-FGCO`, `LABEL-FGCOL`, `LABEL-FGCOLO`, `LABEL-FGCOLOR`, `LABEL-FONT`, `LABEL-PFC`, `LABEL-PFCO`, `LABEL-PFCOL`, `LABEL-PFCOLO`, `LABEL-PFCOLOR`, `LABELS`, `LABELS-HAVE-COLONS`, `LANDSCAPE`, `LANGUAGE`, `LANGUAGES`, `LARGE`, `LARGE-TO-SMALL`, `LAST`, `LAST-ASYNCH-REQUEST`, `LAST-BATCH`, `LAST-CHILD`, `LAST-EVEN`, `LAST-EVENT`, `LAST-FORM`, `LAST-KEY`, `LAST-OBJECT`, `LAST-OF`, `LAST-PROCE`, `LAST-PROCED`, `LAST-PROCEDU`, `LAST-PROCEDUR`, `LAST-PROCEDURE`, `LAST-SERVER`, `LAST-TAB-I`, `LAST-TAB-IT`, `LAST-TAB-ITE`, `LAST-TAB-ITEM`, `LASTKEY`, `LC`, `LDBNAME`, `LE`, `LEAVE`, `LEFT-ALIGN`, `LEFT-ALIGNE`, `LEFT-ALIGNED`, `LEFT-TRIM`, `LENGTH`, `LIBRARY`, `LIKE`, `LIKE-SEQUENTIAL`, `LINE`, `LINE-COUNT`, `LINE-COUNTE`, `LINE-COUNTER`, `LIST-EVENTS`, `LIST-ITEM-PAIRS`, `LIST-ITEMS`, `LIST-PROPERTY-NAMES`, `LIST-QUERY-ATTRS`, `LIST-SET-ATTRS`, `LIST-WIDGETS`, `LISTI`, `LISTIN`, `LISTING`, `LITERAL-QUESTION`, `LITTLE-ENDIAN`, `LOAD`, `LOAD-DOMAINS`, `LOAD-ICON`, `LOAD-IMAGE`, `LOAD-IMAGE-DOWN`, `LOAD-IMAGE-INSENSITIVE`, `LOAD-IMAGE-UP`, `LOAD-MOUSE-P`, `LOAD-MOUSE-PO`, `LOAD-MOUSE-POI`, `LOAD-MOUSE-POIN`, `LOAD-MOUSE-POINT`, `LOAD-MOUSE-POINTE`, `LOAD-MOUSE-POINTER`, `LOAD-PICTURE`, `LOAD-SMALL-ICON`, `LOCAL-NAME`, `LOCAL-VERSION-INFO`, `LOCATOR-COLUMN-NUMBER`, `LOCATOR-LINE-NUMBER`, `LOCATOR-PUBLIC-ID`, `LOCATOR-SYSTEM-ID`, `LOCATOR-TYPE`, `LOCK-REGISTRATION`, `LOCKED`, `LOG`, `LOG-AUDIT-EVENT`, `LOG-MANAGER`, `LOGICAL`, `LOGIN-EXPIRATION-TIMESTAMP`, `LOGIN-HOST`, `LOGIN-STATE`, `LOGOUT`, `LONGCHAR`, `LOOKAHEAD`, `LOOKUP`, `LT`, `MACHINE-CLASS`, `MANDATORY`, `MANUAL-HIGHLIGHT`, `MAP`, `MARGIN-EXTRA`, `MARGIN-HEIGHT`, `MARGIN-HEIGHT-`, `MARGIN-HEIGHT-C`, `MARGIN-HEIGHT-CH`, `MARGIN-HEIGHT-CHA`, `MARGIN-HEIGHT-CHAR`, `MARGIN-HEIGHT-CHARS`, `MARGIN-HEIGHT-P`, `MARGIN-HEIGHT-PI`, `MARGIN-HEIGHT-PIX`, `MARGIN-HEIGHT-PIXE`, `MARGIN-HEIGHT-PIXEL`, `MARGIN-HEIGHT-PIXELS`, `MARGIN-WIDTH`, `MARGIN-WIDTH-`, `MARGIN-WIDTH-C`, `MARGIN-WIDTH-CH`, `MARGIN-WIDTH-CHA`, `MARGIN-WIDTH-CHAR`, `MARGIN-WIDTH-CHARS`, `MARGIN-WIDTH-P`, `MARGIN-WIDTH-PI`, `MARGIN-WIDTH-PIX`, `MARGIN-WIDTH-PIXE`, `MARGIN-WIDTH-PIXEL`, `MARGIN-WIDTH-PIXELS`, `MARK-NEW`, `MARK-ROW-STATE`, `MATCHES`, `MAX`, `MAX-BUTTON`, `MAX-CHARS`, `MAX-DATA-GUESS`, `MAX-HEIGHT`, `MAX-HEIGHT-C`, `MAX-HEIGHT-CH`, `MAX-HEIGHT-CHA`, `MAX-HEIGHT-CHAR`, `MAX-HEIGHT-CHARS`, `MAX-HEIGHT-P`, `MAX-HEIGHT-PI`, `MAX-HEIGHT-PIX`, `MAX-HEIGHT-PIXE`, `MAX-HEIGHT-PIXEL`, `MAX-HEIGHT-PIXELS`, `MAX-ROWS`, `MAX-SIZE`, `MAX-VAL`, `MAX-VALU`, `MAX-VALUE`, `MAX-WIDTH`, `MAX-WIDTH-`, `MAX-WIDTH-C`, `MAX-WIDTH-CH`, `MAX-WIDTH-CHA`, `MAX-WIDTH-CHAR`, `MAX-WIDTH-CHARS`, `MAX-WIDTH-P`, `MAX-WIDTH-PI`, `MAX-WIDTH-PIX`, `MAX-WIDTH-PIXE`, `MAX-WIDTH-PIXEL`, `MAX-WIDTH-PIXELS`, `MAXI`, `MAXIM`, `MAXIMIZE`, `MAXIMU`, `MAXIMUM`, `MAXIMUM-LEVEL`, `MD5-DIGEST`, `MEMBER`, `MEMPTR-TO-NODE-VALUE`, `MENU`, `MENU-BAR`, `MENU-ITEM`, `MENU-K`, `MENU-KE`, `MENU-KEY`, `MENU-M`, `MENU-MO`, `MENU-MOU`, `MENU-MOUS`, `MENU-MOUSE`, `MENUBAR`, `MERGE-BY-FIELD`, `MESSAGE`, `MESSAGE-AREA`, `MESSAGE-AREA-FONT`, `MESSAGE-LINES`, `METHOD`, `MIN`, `MIN-BUTTON`, `MIN-COLUMN-WIDTH-C`, `MIN-COLUMN-WIDTH-CH`, `MIN-COLUMN-WIDTH-CHA`, `MIN-COLUMN-WIDTH-CHAR`, `MIN-COLUMN-WIDTH-CHARS`, `MIN-COLUMN-WIDTH-P`, `MIN-COLUMN-WIDTH-PI`, `MIN-COLUMN-WIDTH-PIX`, `MIN-COLUMN-WIDTH-PIXE`, `MIN-COLUMN-WIDTH-PIXEL`, `MIN-COLUMN-WIDTH-PIXELS`, `MIN-HEIGHT`, `MIN-HEIGHT-`, `MIN-HEIGHT-C`, `MIN-HEIGHT-CH`, `MIN-HEIGHT-CHA`, `MIN-HEIGHT-CHAR`, `MIN-HEIGHT-CHARS`, `MIN-HEIGHT-P`, `MIN-HEIGHT-PI`, `MIN-HEIGHT-PIX`, `MIN-HEIGHT-PIXE`, `MIN-HEIGHT-PIXEL`, `MIN-HEIGHT-PIXELS`, `MIN-SIZE`, `MIN-VAL`, `MIN-VALU`, `MIN-VALUE`, `MIN-WIDTH`, `MIN-WIDTH-`, `MIN-WIDTH-C`, `MIN-WIDTH-CH`, `MIN-WIDTH-CHA`, `MIN-WIDTH-CHAR`, `MIN-WIDTH-CHARS`, `MIN-WIDTH-P`, `MIN-WIDTH-PI`, `MIN-WIDTH-PIX`, `MIN-WIDTH-PIXE`, `MIN-WIDTH-PIXEL`, `MIN-WIDTH-PIXELS`, `MINI`, `MINIM`, `MINIMU`, `MINIMUM`, `MOD`, `MODIFIED`, `MODU`, `MODUL`, `MODULO`, `MONTH`, `MOUSE`, `MOUSE-P`, `MOUSE-PO`, `MOUSE-POI`, `MOUSE-POIN`, `MOUSE-POINT`, `MOUSE-POINTE`, `MOUSE-POINTER`, `MOVABLE`, `MOVE-AFTER`, `MOVE-AFTER-`, `MOVE-AFTER-T`, `MOVE-AFTER-TA`, `MOVE-AFTER-TAB`, `MOVE-AFTER-TAB-`, `MOVE-AFTER-TAB-I`, `MOVE-AFTER-TAB-IT`, `MOVE-AFTER-TAB-ITE`, `MOVE-AFTER-TAB-ITEM`, `MOVE-BEFOR`, `MOVE-BEFORE`, `MOVE-BEFORE-`, `MOVE-BEFORE-T`, `MOVE-BEFORE-TA`, `MOVE-BEFORE-TAB`, `MOVE-BEFORE-TAB-`, `MOVE-BEFORE-TAB-I`, `MOVE-BEFORE-TAB-IT`, `MOVE-BEFORE-TAB-ITE`, `MOVE-BEFORE-TAB-ITEM`, `MOVE-COL`, `MOVE-COLU`, `MOVE-COLUM`, `MOVE-COLUMN`, `MOVE-TO-B`, `MOVE-TO-BO`, `MOVE-TO-BOT`, `MOVE-TO-BOTT`, `MOVE-TO-BOTTO`, `MOVE-TO-BOTTOM`, `MOVE-TO-EOF`, `MOVE-TO-T`, `MOVE-TO-TO`, `MOVE-TO-TOP`, `MPE`, `MTIME`, `MULTI-COMPILE`, `MULTIPLE`, `MULTIPLE-KEY`, `MULTITASKING-INTERVAL`, `MUST-EXIST`, `NAME`, `NAMESPACE-PREFIX`, `NAMESPACE-URI`, `NATIVE`, `NE`, `NEEDS-APPSERVER-PROMPT`, `NEEDS-PROMPT`, `NEW`, `NEW-INSTANCE`, `NEW-ROW`, `NEXT`, `NEXT-COLUMN`, `NEXT-PROMPT`, `NEXT-ROWID`, `NEXT-SIBLING`, `NEXT-TAB-I`, `NEXT-TAB-IT`, `NEXT-TAB-ITE`, `NEXT-TAB-ITEM`, `NEXT-VALUE`, `NO`, `NO-APPLY`, `NO-ARRAY-MESSAGE`, `NO-ASSIGN`, `NO-ATTR`, `NO-ATTR-`, `NO-ATTR-L`, `NO-ATTR-LI`, `NO-ATTR-LIS`, `NO-ATTR-LIST`, `NO-ATTR-S`, `NO-ATTR-SP`, `NO-ATTR-SPA`, `NO-ATTR-SPAC`, `NO-ATTR-SPACE`, `NO-AUTO-VALIDATE`, `NO-BIND-WHERE`, `NO-BOX`, `NO-CONSOLE`, `NO-CONVERT`, `NO-CONVERT-3D-COLORS`, `NO-CURRENT-VALUE`, `NO-DEBUG`, `NO-DRAG`, `NO-ECHO`, `NO-EMPTY-SPACE`, `NO-ERROR`, `NO-F`, `NO-FI`, `NO-FIL`, `NO-FILL`, `NO-FOCUS`, `NO-HELP`, `NO-HIDE`, `NO-INDEX-HINT`, `NO-INHERIT-BGC`, `NO-INHERIT-BGCO`, `NO-INHERIT-BGCOLOR`, `NO-INHERIT-FGC`, `NO-INHERIT-FGCO`, `NO-INHERIT-FGCOL`, `NO-INHERIT-FGCOLO`, `NO-INHERIT-FGCOLOR`, `NO-JOIN-BY-SQLDB`, `NO-LABE`, `NO-LABELS`, `NO-LOBS`, `NO-LOCK`, `NO-LOOKAHEAD`, `NO-MAP`, `NO-MES`, `NO-MESS`, `NO-MESSA`, `NO-MESSAG`, `NO-MESSAGE`, `NO-PAUSE`, `NO-PREFE`, `NO-PREFET`, `NO-PREFETC`, `NO-PREFETCH`, `NO-ROW-MARKERS`, `NO-SCROLLBAR-VERTICAL`, `NO-SEPARATE-CONNECTION`, `NO-SEPARATORS`, `NO-TAB-STOP`, `NO-UND`, `NO-UNDE`, `NO-UNDER`, `NO-UNDERL`, `NO-UNDERLI`, `NO-UNDERLIN`, `NO-UNDERLINE`, `NO-UNDO`, `NO-VAL`, `NO-VALI`, `NO-VALID`, `NO-VALIDA`, `NO-VALIDAT`, `NO-VALIDATE`, `NO-WAIT`, `NO-WORD-WRAP`, `NODE-VALUE-TO-MEMPTR`, `NONAMESPACE-SCHEMA-LOCATION`, `NONE`, `NORMALIZE`, `NOT`, `NOT-ACTIVE`, `NOW`, `NULL`, `NUM-ALI`, `NUM-ALIA`, `NUM-ALIAS`, `NUM-ALIASE`, `NUM-ALIASES`, `NUM-BUFFERS`, `NUM-BUT`, `NUM-BUTT`, `NUM-BUTTO`, `NUM-BUTTON`, `NUM-BUTTONS`, `NUM-COL`, `NUM-COLU`, `NUM-COLUM`, `NUM-COLUMN`, `NUM-COLUMNS`, `NUM-COPIES`, `NUM-DBS`, `NUM-DROPPED-FILES`, `NUM-ENTRIES`, `NUM-FIELDS`, `NUM-FORMATS`, `NUM-ITEMS`, `NUM-ITERATIONS`, `NUM-LINES`, `NUM-LOCKED-COL`, `NUM-LOCKED-COLU`, `NUM-LOCKED-COLUM`, `NUM-LOCKED-COLUMN`, `NUM-LOCKED-COLUMNS`, `NUM-MESSAGES`, `NUM-PARAMETERS`, `NUM-REFERENCES`, `NUM-REPLACED`, `NUM-RESULTS`, `NUM-SELECTED`, `NUM-SELECTED-`, `NUM-SELECTED-ROWS`, `NUM-SELECTED-W`, `NUM-SELECTED-WI`, `NUM-SELECTED-WID`, `NUM-SELECTED-WIDG`, `NUM-SELECTED-WIDGE`, `NUM-SELECTED-WIDGET`, `NUM-SELECTED-WIDGETS`, `NUM-TABS`, `NUM-TO-RETAIN`, `NUM-VISIBLE-COLUMNS`, `NUMERIC`, `NUMERIC-F`, `NUMERIC-FO`, `NUMERIC-FOR`, `NUMERIC-FORM`, `NUMERIC-FORMA`, `NUMERIC-FORMAT`, `OCTET-LENGTH`, `OF`, `OFF`, `OK`, `OK-CANCEL`, `OLD`, `ON`, `ON-FRAME`, `ON-FRAME-`, `ON-FRAME-B`, `ON-FRAME-BO`, `ON-FRAME-BOR`, `ON-FRAME-BORD`, `ON-FRAME-BORDE`, `ON-FRAME-BORDER`, `OPEN`, `OPSYS`, `OPTION`, `OR`, `ORDERED-JOIN`, `ORDINAL`, `OS-APPEND`, `OS-COMMAND`, `OS-COPY`, `OS-CREATE-DIR`, `OS-DELETE`, `OS-DIR`, `OS-DRIVE`, `OS-DRIVES`, `OS-ERROR`, `OS-GETENV`, `OS-RENAME`, `OTHERWISE`, `OUTPUT`, `OVERLAY`, `OVERRIDE`, `OWNER`, `PAGE`, `PAGE-BOT`, `PAGE-BOTT`, `PAGE-BOTTO`, `PAGE-BOTTOM`, `PAGE-NUM`, `PAGE-NUMB`, `PAGE-NUMBE`, `PAGE-NUMBER`, `PAGE-SIZE`, `PAGE-TOP`, `PAGE-WID`, `PAGE-WIDT`, `PAGE-WIDTH`, `PAGED`, `PARAM`, `PARAME`, `PARAMET`, `PARAMETE`, `PARAMETER`, `PARENT`, `PARSE-STATUS`, `PARTIAL-KEY`, `PASCAL`, `PASSWORD-FIELD`, `PATHNAME`, `PAUSE`, `PBE-HASH-ALG`, `PBE-HASH-ALGO`, `PBE-HASH-ALGOR`, `PBE-HASH-ALGORI`, `PBE-HASH-ALGORIT`, `PBE-HASH-ALGORITH`, `PBE-HASH-ALGORITHM`, `PBE-KEY-ROUNDS`, `PDBNAME`, `PERSIST`, `PERSISTE`, `PERSISTEN`, `PERSISTENT`, `PERSISTENT-CACHE-DISABLED`, `PFC`, `PFCO`, `PFCOL`, `PFCOLO`, `PFCOLOR`, `PIXELS`, `PIXELS-PER-COL`, `PIXELS-PER-COLU`, `PIXELS-PER-COLUM`, `PIXELS-PER-COLUMN`, `PIXELS-PER-ROW`, `POPUP-M`, `POPUP-ME`, `POPUP-MEN`, `POPUP-MENU`, `POPUP-O`, `POPUP-ON`, `POPUP-ONL`, `POPUP-ONLY`, `PORTRAIT`, `POSITION`, `PRECISION`, `PREFER-DATASET`, `PREPARE-STRING`, `PREPARED`, `PREPROC`, `PREPROCE`, `PREPROCES`, `PREPROCESS`, `PRESEL`, `PRESELE`, `PRESELEC`, `PRESELECT`, `PREV`, `PREV-COLUMN`, `PREV-SIBLING`, `PREV-TAB-I`, `PREV-TAB-IT`, `PREV-TAB-ITE`, `PREV-TAB-ITEM`, `PRIMARY`, `PRINTER`, `PRINTER-CONTROL-HANDLE`, `PRINTER-HDC`, `PRINTER-NAME`, `PRINTER-PORT`, `PRINTER-SETUP`, `PRIVATE`, `PRIVATE-D`, `PRIVATE-DA`, `PRIVATE-DAT`, `PRIVATE-DATA`, `PRIVILEGES`, `PROC-HA`, `PROC-HAN`, `PROC-HAND`, `PROC-HANDL`, `PROC-HANDLE`, `PROC-ST`, `PROC-STA`, `PROC-STAT`, `PROC-STATU`, `PROC-STATUS`, `PROC-TEXT`, `PROC-TEXT-BUFFER`, `PROCE`, `PROCED`, `PROCEDU`, `PROCEDUR`, `PROCEDURE`, `PROCEDURE-CALL-TYPE`, `PROCEDURE-TYPE`, `PROCESS`, `PROFILER`, `PROGRAM-NAME`, `PROGRESS`, `PROGRESS-S`, `PROGRESS-SO`, `PROGRESS-SOU`, `PROGRESS-SOUR`, `PROGRESS-SOURC`, `PROGRESS-SOURCE`, `PROMPT`, `PROMPT-F`, `PROMPT-FO`, `PROMPT-FOR`, `PROMSGS`, `PROPATH`, `PROPERTY`, `PROTECTED`, `PROVERS`, `PROVERSI`, `PROVERSIO`, `PROVERSION`, `PROXY`, `PROXY-PASSWORD`, `PROXY-USERID`, `PUBLIC`, `PUBLIC-ID`, `PUBLISH`, `PUBLISHED-EVENTS`, `PUT`, `PUT-BYTE`, `PUT-DOUBLE`, `PUT-FLOAT`, `PUT-INT64`, `PUT-KEY-VAL`, `PUT-KEY-VALU`, `PUT-KEY-VALUE`, `PUT-LONG`, `PUT-SHORT`, `PUT-STRING`, `PUT-UNSIGNED-LONG`, `PUTBYTE`, `QUERY`, `QUERY-CLOSE`, `QUERY-OFF-END`, `QUERY-OPEN`, `QUERY-PREPARE`, `QUERY-TUNING`, `QUESTION`, `QUIT`, `QUOTER`, `R-INDEX`, `RADIO-BUTTONS`, `RADIO-SET`, `RANDOM`, `RAW`, `RAW-TRANSFER`, `RCODE-INFO`, `RCODE-INFOR`, `RCODE-INFORM`, `RCODE-INFORMA`, `RCODE-INFORMAT`, `RCODE-INFORMATI`, `RCODE-INFORMATIO`, `RCODE-INFORMATION`, `READ-AVAILABLE`, `READ-EXACT-NUM`, `READ-FILE`, `READ-JSON`, `READ-ONLY`, `READ-XML`, `READ-XMLSCHEMA`, `READKEY`, `REAL`, `RECID`, `RECORD-LENGTH`, `RECT`, `RECTA`, `RECTAN`, `RECTANG`, `RECTANGL`, `RECTANGLE`, `RECURSIVE`, `REFERENCE-ONLY`, `REFRESH`, `REFRESH-AUDIT-POLICY`, `REFRESHABLE`, `REGISTER-DOMAIN`, `RELEASE`, `REMOTE`, `REMOVE-EVENTS-PROCEDURE`, `REMOVE-SUPER-PROCEDURE`, `REPEAT`, `REPLACE`, `REPLACE-SELECTION-TEXT`, `REPOSITION`, `REPOSITION-BACKWARD`, `REPOSITION-FORWARD`, `REPOSITION-MODE`, `REPOSITION-TO-ROW`, `REPOSITION-TO-ROWID`, `REQUEST`, `REQUEST-INFO`, `RESET`, `RESIZA`, `RESIZAB`, `RESIZABL`, `RESIZABLE`, `RESIZE`, `RESPONSE-INFO`, `RESTART-ROW`, `RESTART-ROWID`, `RETAIN`, `RETAIN-SHAPE`, `RETRY`, `RETRY-CANCEL`, `RETURN`, `RETURN-ALIGN`, `RETURN-ALIGNE`, `RETURN-INS`, `RETURN-INSE`, `RETURN-INSER`, `RETURN-INSERT`, `RETURN-INSERTE`, `RETURN-INSERTED`, `RETURN-TO-START-DI`, `RETURN-TO-START-DIR`, `RETURN-VAL`, `RETURN-VALU`, `RETURN-VALUE`, `RETURN-VALUE-DATA-TYPE`, `RETURNS`, `REVERSE-FROM`, `REVERT`, `REVOKE`, `RGB-VALUE`, `RIGHT-ALIGNED`, `RIGHT-TRIM`, `ROLES`, `ROUND`, `ROUTINE-LEVEL`, `ROW`, `ROW-HEIGHT-CHARS`, `ROW-HEIGHT-PIXELS`, `ROW-MARKERS`, `ROW-OF`, `ROW-RESIZABLE`, `ROWID`, `RULE`, `RUN`, `RUN-PROCEDURE`, `SAVE CACHE`, `SAVE`, `SAVE-AS`, `SAVE-FILE`, `SAX-COMPLE`, `SAX-COMPLET`, `SAX-COMPLETE`, `SAX-PARSE`, `SAX-PARSE-FIRST`, `SAX-PARSE-NEXT`, `SAX-PARSER-ERROR`, `SAX-RUNNING`, `SAX-UNINITIALIZED`, `SAX-WRITE-BEGIN`, `SAX-WRITE-COMPLETE`, `SAX-WRITE-CONTENT`, `SAX-WRITE-ELEMENT`, `SAX-WRITE-ERROR`, `SAX-WRITE-IDLE`, `SAX-WRITE-TAG`, `SAX-WRITER`, `SCHEMA`, `SCHEMA-LOCATION`, `SCHEMA-MARSHAL`, `SCHEMA-PATH`, `SCREEN`, `SCREEN-IO`, `SCREEN-LINES`, `SCREEN-VAL`, `SCREEN-VALU`, `SCREEN-VALUE`, `SCROLL`, `SCROLL-BARS`, `SCROLL-DELTA`, `SCROLL-OFFSET`, `SCROLL-TO-CURRENT-ROW`, `SCROLL-TO-I`, `SCROLL-TO-IT`, `SCROLL-TO-ITE`, `SCROLL-TO-ITEM`, `SCROLL-TO-SELECTED-ROW`, `SCROLLABLE`, `SCROLLBAR-H`, `SCROLLBAR-HO`, `SCROLLBAR-HOR`, `SCROLLBAR-HORI`, `SCROLLBAR-HORIZ`, `SCROLLBAR-HORIZO`, `SCROLLBAR-HORIZON`, `SCROLLBAR-HORIZONT`, `SCROLLBAR-HORIZONTA`, `SCROLLBAR-HORIZONTAL`, `SCROLLBAR-V`, `SCROLLBAR-VE`, `SCROLLBAR-VER`, `SCROLLBAR-VERT`, `SCROLLBAR-VERTI`, `SCROLLBAR-VERTIC`, `SCROLLBAR-VERTICA`, `SCROLLBAR-VERTICAL`, `SCROLLED-ROW-POS`, `SCROLLED-ROW-POSI`, `SCROLLED-ROW-POSIT`, `SCROLLED-ROW-POSITI`, `SCROLLED-ROW-POSITIO`, `SCROLLED-ROW-POSITION`, `SCROLLING`, `SDBNAME`, `SEAL`, `SEAL-TIMESTAMP`, `SEARCH`, `SEARCH-SELF`, `SEARCH-TARGET`, `SECTION`, `SECURITY-POLICY`, `SEEK`, `SELECT`, `SELECT-ALL`, `SELECT-FOCUSED-ROW`, `SELECT-NEXT-ROW`, `SELECT-PREV-ROW`, `SELECT-ROW`, `SELECTABLE`, `SELECTED`, `SELECTION`, `SELECTION-END`, `SELECTION-LIST`, `SELECTION-START`, `SELECTION-TEXT`, `SELF`, `SEND`, `SEND-SQL-STATEMENT`, `SENSITIVE`, `SEPARATE-CONNECTION`, `SEPARATOR-FGCOLOR`, `SEPARATORS`, `SERIALIZABLE`, `SERIALIZE-HIDDEN`, `SERIALIZE-NAME`, `SERVER`, `SERVER-CONNECTION-BOUND`, `SERVER-CONNECTION-BOUND-REQUEST`, `SERVER-CONNECTION-CONTEXT`, `SERVER-CONNECTION-ID`, `SERVER-OPERATING-MODE`, `SESSION`, `SESSION-ID`, `SET`, `SET-APPL-CONTEXT`, `SET-ATTR-CALL-TYPE`, `SET-ATTRIBUTE-NODE`, `SET-BLUE`, `SET-BLUE-`, `SET-BLUE-V`, `SET-BLUE-VA`, `SET-BLUE-VAL`, `SET-BLUE-VALU`, `SET-BLUE-VALUE`, `SET-BREAK`, `SET-BUFFERS`, `SET-CALLBACK`, `SET-CLIENT`, `SET-COMMIT`, `SET-CONTENTS`, `SET-CURRENT-VALUE`, `SET-DB-CLIENT`, `SET-DYNAMIC`, `SET-EVENT-MANAGER-OPTION`, `SET-GREEN`, `SET-GREEN-`, `SET-GREEN-V`, `SET-GREEN-VA`, `SET-GREEN-VAL`, `SET-GREEN-VALU`, `SET-GREEN-VALUE`, `SET-INPUT-SOURCE`, `SET-OPTION`, `SET-OUTPUT-DESTINATION`, `SET-PARAMETER`, `SET-POINTER-VALUE`, `SET-PROPERTY`, `SET-RED`, `SET-RED-`, `SET-RED-V`, `SET-RED-VA`, `SET-RED-VAL`, `SET-RED-VALU`, `SET-RED-VALUE`, `SET-REPOSITIONED-ROW`, `SET-RGB-VALUE`, `SET-ROLLBACK`, `SET-SELECTION`, `SET-SIZE`, `SET-SORT-ARROW`, `SET-WAIT-STATE`, `SETUSER`, `SETUSERI`, `SETUSERID`, `SHA1-DIGEST`, `SHARE`, `SHARE-`, `SHARE-L`, `SHARE-LO`, `SHARE-LOC`, `SHARE-LOCK`, `SHARED`, `SHOW-IN-TASKBAR`, `SHOW-STAT`, `SHOW-STATS`, `SIDE-LAB`, `SIDE-LABE`, `SIDE-LABEL`, `SIDE-LABEL-H`, `SIDE-LABEL-HA`, `SIDE-LABEL-HAN`, `SIDE-LABEL-HAND`, `SIDE-LABEL-HANDL`, `SIDE-LABEL-HANDLE`, `SIDE-LABELS`, `SIGNATURE`, `SILENT`, `SIMPLE`, `SINGLE`, `SINGLE-RUN`, `SINGLETON`, `SIZE`, `SIZE-C`, `SIZE-CH`, `SIZE-CHA`, `SIZE-CHAR`, `SIZE-CHARS`, `SIZE-P`, `SIZE-PI`, `SIZE-PIX`, `SIZE-PIXE`, `SIZE-PIXEL`, `SIZE-PIXELS`, `SKIP`, `SKIP-DELETED-RECORD`, `SLIDER`, `SMALL-ICON`, `SMALL-TITLE`, `SMALLINT`, `SOME`, `SORT`, `SORT-ASCENDING`, `SORT-NUMBER`, `SOURCE`, `SOURCE-PROCEDURE`, `SPACE`, `SQL`, `SQRT`, `SSL-SERVER-NAME`, `STANDALONE`, `START`, `START-DOCUMENT`, `START-ELEMENT`, `START-MOVE`, `START-RESIZE`, `START-ROW-RESIZE`, `STATE-DETAIL`, `STATIC`, `STATUS`, `STATUS-AREA`, `STATUS-AREA-FONT`, `STDCALL`, `STOP`, `STOP-AFTER`, `STOP-PARSING`, `STOPPE`, `STOPPED`, `STORED-PROC`, `STORED-PROCE`, `STORED-PROCED`, `STORED-PROCEDU`, `STORED-PROCEDUR`, `STORED-PROCEDURE`, `STREAM`, `STREAM-HANDLE`, `STREAM-IO`, `STRETCH-TO-FIT`, `STRICT`, `STRICT-ENTITY-RESOLUTION`, `STRING`, `STRING-VALUE`, `STRING-XREF`, `SUB-AVE`, `SUB-AVER`, `SUB-AVERA`, `SUB-AVERAG`, `SUB-AVERAGE`, `SUB-COUNT`, `SUB-MAXIMUM`, `SUB-MENU`, `SUB-MIN`, `SUB-MINIMUM`, `SUB-TOTAL`, `SUBSCRIBE`, `SUBST`, `SUBSTI`, `SUBSTIT`, `SUBSTITU`, `SUBSTITUT`, `SUBSTITUTE`, `SUBSTR`, `SUBSTRI`, `SUBSTRIN`, `SUBSTRING`, `SUBTYPE`, `SUM`, `SUM-MAX`, `SUM-MAXI`, `SUM-MAXIM`, `SUM-MAXIMU`, `SUPER`, `SUPER-PROCEDURES`, `SUPPRESS-NAMESPACE-PROCESSING`, `SUPPRESS-W`, `SUPPRESS-WA`, `SUPPRESS-WAR`, `SUPPRESS-WARN`, `SUPPRESS-WARNI`, `SUPPRESS-WARNIN`, `SUPPRESS-WARNING`, `SUPPRESS-WARNINGS`, `SYMMETRIC-ENCRYPTION-ALGORITHM`, `SYMMETRIC-ENCRYPTION-IV`, `SYMMETRIC-ENCRYPTION-KEY`, `SYMMETRIC-SUPPORT`, `SYSTEM-ALERT`, `SYSTEM-ALERT-`, `SYSTEM-ALERT-B`, `SYSTEM-ALERT-BO`, `SYSTEM-ALERT-BOX`, `SYSTEM-ALERT-BOXE`, `SYSTEM-ALERT-BOXES`, `SYSTEM-DIALOG`, `SYSTEM-HELP`, `SYSTEM-ID`, `TAB-POSITION`, `TAB-STOP`, `TABLE`, `TABLE-HANDLE`, `TABLE-NUMBER`, `TABLE-SCAN`, `TARGET`, `TARGET-PROCEDURE`, `TEMP-DIR`, `TEMP-DIRE`, `TEMP-DIREC`, `TEMP-DIRECT`, `TEMP-DIRECTO`, `TEMP-DIRECTOR`, `TEMP-DIRECTORY`, `TEMP-TABLE`, `TEMP-TABLE-PREPARE`, `TERM`, `TERMI`, `TERMIN`, `TERMINA`, `TERMINAL`, `TERMINATE`, `TEXT`, `TEXT-CURSOR`, `TEXT-SEG-GROW`, `TEXT-SELECTED`, `THEN`, `THIS-OBJECT`, `THIS-PROCEDURE`, `THREAD-SAFE`, `THREE-D`, `THROUGH`, `THROW`, `THRU`, `TIC-MARKS`, `TIME`, `TIME-SOURCE`, `TITLE`, `TITLE-BGC`, `TITLE-BGCO`, `TITLE-BGCOL`, `TITLE-BGCOLO`, `TITLE-BGCOLOR`, `TITLE-DC`, `TITLE-DCO`, `TITLE-DCOL`, `TITLE-DCOLO`, `TITLE-DCOLOR`, `TITLE-FGC`, `TITLE-FGCO`, `TITLE-FGCOL`, `TITLE-FGCOLO`, `TITLE-FGCOLOR`, `TITLE-FO`, `TITLE-FON`, `TITLE-FONT`, `TO`, `TO-ROWID`, `TODAY`, `TOGGLE-BOX`, `TOOLTIP`, `TOOLTIPS`, `TOP-NAV-QUERY`, `TOP-ONLY`, `TOPIC`, `TOTAL`, `TRAILING`, `TRANS`, `TRANS-INIT-PROCEDURE`, `TRANSACTION`, `TRANSACTION-MODE`, `TRANSPARENT`, `TRIGGER`, `TRIGGERS`, `TRIM`, `TRUE`, `TRUNC`, `TRUNCA`, `TRUNCAT`, `TRUNCATE`, `TYPE`, `TYPE-OF`, `UNBOX`, `UNBUFF`, `UNBUFFE`, `UNBUFFER`, `UNBUFFERE`, `UNBUFFERED`, `UNDERL`, `UNDERLI`, `UNDERLIN`, `UNDERLINE`, `UNDO`, `UNFORM`, `UNFORMA`, `UNFORMAT`, `UNFORMATT`, `UNFORMATTE`, `UNFORMATTED`, `UNION`, `UNIQUE`, `UNIQUE-ID`, `UNIQUE-MATCH`, `UNIX`, `UNLESS-HIDDEN`, `UNLOAD`, `UNSIGNED-LONG`, `UNSUBSCRIBE`, `UP`, `UPDATE`, `UPDATE-ATTRIBUTE`, `URL`, `URL-DECODE`, `URL-ENCODE`, `URL-PASSWORD`, `URL-USERID`, `USE`, `USE-DICT-EXPS`, `USE-FILENAME`, `USE-INDEX`, `USE-REVVIDEO`, `USE-TEXT`, `USE-UNDERLINE`, `USE-WIDGET-POOL`, `USER`, `USER-ID`, `USERID`, `USING`, `V6DISPLAY`, `V6FRAME`, `VALID-EVENT`, `VALID-HANDLE`, `VALID-OBJECT`, `VALIDATE`, `VALIDATE-EXPRESSION`, `VALIDATE-MESSAGE`, `VALIDATE-SEAL`, `VALIDATION-ENABLED`, `VALUE`, `VALUE-CHANGED`, `VALUES`, `VAR`, `VARI`, `VARIA`, `VARIAB`, `VARIABL`, `VARIABLE`, `VERBOSE`, `VERSION`, `VERT`, `VERTI`, `VERTIC`, `VERTICA`, `VERTICAL`, `VIEW`, `VIEW-AS`, `VIEW-FIRST-COLUMN-ON-REOPEN`, `VIRTUAL-HEIGHT`, `VIRTUAL-HEIGHT-`, `VIRTUAL-HEIGHT-C`, `VIRTUAL-HEIGHT-CH`, `VIRTUAL-HEIGHT-CHA`, `VIRTUAL-HEIGHT-CHAR`, `VIRTUAL-HEIGHT-CHARS`, `VIRTUAL-HEIGHT-P`, `VIRTUAL-HEIGHT-PI`, `VIRTUAL-HEIGHT-PIX`, `VIRTUAL-HEIGHT-PIXE`, `VIRTUAL-HEIGHT-PIXEL`, `VIRTUAL-HEIGHT-PIXELS`, `VIRTUAL-WIDTH`, `VIRTUAL-WIDTH-`, `VIRTUAL-WIDTH-C`, `VIRTUAL-WIDTH-CH`, `VIRTUAL-WIDTH-CHA`, `VIRTUAL-WIDTH-CHAR`, `VIRTUAL-WIDTH-CHARS`, `VIRTUAL-WIDTH-P`, `VIRTUAL-WIDTH-PI`, `VIRTUAL-WIDTH-PIX`, `VIRTUAL-WIDTH-PIXE`, `VIRTUAL-WIDTH-PIXEL`, `VIRTUAL-WIDTH-PIXELS`, `VISIBLE`, `VOID`, `WAIT`, `WAIT-FOR`, `WARNING`, `WEB-CONTEXT`, `WEEKDAY`, `WHEN`, `WHERE`, `WHILE`, `WIDGET`, `WIDGET-E`, `WIDGET-EN`, `WIDGET-ENT`, `WIDGET-ENTE`, `WIDGET-ENTER`, `WIDGET-ID`, `WIDGET-L`, `WIDGET-LE`, `WIDGET-LEA`, `WIDGET-LEAV`, `WIDGET-LEAVE`, `WIDGET-POOL`, `WIDTH`, `WIDTH-`, `WIDTH-C`, `WIDTH-CH`, `WIDTH-CHA`, `WIDTH-CHAR`, `WIDTH-CHARS`, `WIDTH-P`, `WIDTH-PI`, `WIDTH-PIX`, `WIDTH-PIXE`, `WIDTH-PIXEL`, `WIDTH-PIXELS`, `WINDOW`, `WINDOW-MAXIM`, `WINDOW-MAXIMI`, `WINDOW-MAXIMIZ`, `WINDOW-MAXIMIZE`, `WINDOW-MAXIMIZED`, `WINDOW-MINIM`, `WINDOW-MINIMI`, `WINDOW-MINIMIZ`, `WINDOW-MINIMIZE`, `WINDOW-MINIMIZED`, `WINDOW-NAME`, `WINDOW-NORMAL`, `WINDOW-STA`, `WINDOW-STAT`, `WINDOW-STATE`, `WINDOW-SYSTEM`, `WITH`, `WORD-INDEX`, `WORD-WRAP`, `WORK-AREA-HEIGHT-PIXELS`, `WORK-AREA-WIDTH-PIXELS`, `WORK-AREA-X`, `WORK-AREA-Y`, `WORK-TAB`, `WORK-TABL`, `WORK-TABLE`, `WORKFILE`, `WRITE`, `WRITE-CDATA`, `WRITE-CHARACTERS`, `WRITE-COMMENT`, `WRITE-DATA-ELEMENT`, `WRITE-EMPTY-ELEMENT`, `WRITE-ENTITY-REF`, `WRITE-EXTERNAL-DTD`, `WRITE-FRAGMENT`, `WRITE-JSON`, `WRITE-MESSAGE`, `WRITE-PROCESSING-INSTRUCTION`, `WRITE-STATUS`, `WRITE-XML`, `WRITE-XMLSCHEMA`, `X`, `X-OF`, `XCODE`, `XML-DATA-TYPE`, `XML-ENTITY-EXPANSION-LIMIT`, `XML-NODE-TYPE`, `XML-SCHEMA-PATH`, `XML-STRICT-ENTITY-RESOLUTION`, `XML-SUPPRESS-NAMESPACE-PROCESSING`, `XREF`, `XREF-XML`, `Y`, `Y-OF`, `YEAR`, `YEAR-OFFSET`, `YES`, `YES-NO`, `YES-NO-CANCEL`), KeywordReserved, nil}, //nolint
+ {`"(\\\\|\\[^\\]|[^"\\])*"`, LiteralStringDouble, nil},
+ {`'(\\\\|\\[^\\]|[^'\\])*'`, LiteralStringSingle, nil},
+ {`[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?`, LiteralNumberFloat, nil},
+ {`[0-9]+`, LiteralNumberInteger, nil},
+ {`\s+`, Text, nil},
+ {`[+*/=-]`, Operator, nil},
+ {`[.:()]`, Punctuation, nil},
+ {`.`, NameVariable, nil},
+ },
+ "comment": {
+ {`[^*/]`, CommentMultiline, nil},
+ {`/\*`, CommentMultiline, Push()},
+ {`\*/`, CommentMultiline, Pop(1)},
+ {`[*/]`, CommentMultiline, nil},
+ {`\/\/`, CommentSingle, nil},
+ },
+ "preprocessor": {
+ {`[^{}]`, CommentPreproc, nil},
+ {`\{`, CommentPreproc, Push()},
+ {`\}`, CommentPreproc, Pop(1)},
+ },
+ }
+ },
+))
diff --git a/vendor/github.com/alecthomas/chroma/lexers/p/plutus_core.go b/vendor/github.com/alecthomas/chroma/lexers/p/plutus_core.go
new file mode 100644
index 0000000..b2ad4e1
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/p/plutus_core.go
@@ -0,0 +1,76 @@
+package p
+
+import (
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// nolint
+
+// Lexer for the Plutus Core Languages (version 2.1)
+//
+// including both Typed- and Untyped- versions
+// based on “Formal Specification of the Plutus Core Language (version 2.1)”, published 6th April 2021:
+// https://hydra.iohk.io/build/8205579/download/1/plutus-core-specification.pdf
+
+var PlutusCoreLang = internal.Register(MustNewLazyLexer(
+ &Config{
+ Name: "Plutus Core",
+ Aliases: []string{"plutus-core", "plc"},
+ Filenames: []string{"*.plc"},
+ MimeTypes: []string{"text/x-plutus-core", "application/x-plutus-core"},
+ },
+ plutusCoreRules,
+))
+
+func plutusCoreRules() Rules {
+ return Rules{
+ "root": {
+ {`\s+`, Text, nil},
+ {`(\(|\))`, Punctuation, nil},
+ {`(\[|\])`, Punctuation, nil},
+ {`({|})`, Punctuation, nil},
+
+ // Constants. Figure 1.
+ // For version, see handling of (program ...) below.
+ {`([+-]?\d+)`, LiteralNumberInteger, nil},
+ {`(#([a-fA-F0-9][a-fA-F0-9])+)`, LiteralString, nil},
+ {`(\(\))`, NameConstant, nil},
+ {`(True|False)`, NameConstant, nil},
+
+ // Keywords. Figures 2 and 15.
+ // Special handling for program because it is followed by a version.
+ {`(con |abs |iwrap |unwrap |lam |builtin |delay |force |error)`, Keyword, nil},
+ {`(fun |all |ifix |lam |con )`, Keyword, nil},
+ {`(type|fun )`, Keyword, nil},
+ {`(program )(\S+)`, ByGroups(Keyword, LiteralString), nil},
+
+ // Built-in Types. Figure 12.
+ {`(unit|bool|integer|bytestring|string)`, KeywordType, nil},
+
+ // Built-ins Functions. Figure 14 but, more importantly, implementation:
+ // https://github.com/input-output-hk/plutus/blob/6d759c4/plutus-core/plutus-core/src/PlutusCore/Default/Builtins.hs#L42-L111
+ {`(addInteger |subtractInteger |multiplyInteger |divideInteger |quotientInteger |remainderInteger |modInteger |equalsInteger |lessThanInteger |lessThanEqualsInteger )`, NameBuiltin, nil},
+ {`(appendByteString |consByteString |sliceByteString |lengthOfByteString |indexByteString |equalsByteString |lessThanByteString |lessThanEqualsByteString )`, NameBuiltin, nil},
+ {`(sha2_256 |sha3_256 |blake2b_256 |verifySignature )`, NameBuiltin, nil},
+ {`(appendString |equalsString |encodeUtf8 |decodeUtf8 )`, NameBuiltin, nil},
+ {`(ifThenElse )`, NameBuiltin, nil},
+ {`(chooseUnit )`, NameBuiltin, nil},
+ {`(trace )`, NameBuiltin, nil},
+ {`(fstPair |sndPair )`, NameBuiltin, nil},
+ {`(chooseList |mkCons |headList |tailList |nullList )`, NameBuiltin, nil},
+ {`(chooseData |constrData |mapData |listData |iData |bData |unConstrData |unMapData |unListData |unIData |unBData |equalsData )`, NameBuiltin, nil},
+ {`(mkPairData |mkNilData |mkNilPairData )`, NameBuiltin, nil},
+
+ // Name. Figure 1.
+ {`([a-zA-Z][a-zA-Z0-9_']*)`, Name, nil},
+
+ // Unicode String. Not in the specification.
+ {`"`, LiteralStringDouble, Push("string")},
+ },
+ "string": {
+ {`[^\\"]+`, LiteralStringDouble, nil},
+ {`"`, LiteralStringDouble, Pop(1)},
+ },
+ }
+}
diff --git a/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go b/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go
index d2f177e..72a99f6 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/s/scheme.go
@@ -30,7 +30,7 @@ func schemeLangRules() Rules {
{`-?\d+`, LiteralNumberInteger, nil},
{`"(\\\\|\\"|[^"])*"`, LiteralString, nil},
{`'[\w!$%&*+,/:<=>?@^~|-]+`, LiteralStringSymbol, nil},
- {`#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)`, LiteralStringChar, nil},
+ {`#\\(alarm|backspace|delete|esc|linefeed|newline|page|return|space|tab|vtab|x[0-9a-zA-Z]{1,5}|.)`, LiteralStringChar, nil},
{`(#t|#f)`, NameConstant, nil},
{"('|#|`|,@|,|\\.)", Operator, nil},
{`(lambda |define |if |else |cond |and |or |case |let |let\* |letrec |begin |do |delay |set\! |\=\> |quote |quasiquote |unquote |unquote\-splicing |define\-syntax |let\-syntax |letrec\-syntax |syntax\-rules )`, Keyword, nil},
diff --git a/vendor/github.com/alecthomas/chroma/lexers/x/xml.go b/vendor/github.com/alecthomas/chroma/lexers/x/xml.go
index 1e93c4e..b98e9a4 100644
--- a/vendor/github.com/alecthomas/chroma/lexers/x/xml.go
+++ b/vendor/github.com/alecthomas/chroma/lexers/x/xml.go
@@ -10,7 +10,7 @@ var XML = internal.Register(MustNewLazyLexer(
&Config{
Name: "XML",
Aliases: []string{"xml"},
- Filenames: []string{"*.xml", "*.xsl", "*.rss", "*.xslt", "*.xsd", "*.wsdl", "*.wsf", "*.svg"},
+ Filenames: []string{"*.xml", "*.xsl", "*.rss", "*.xslt", "*.xsd", "*.wsdl", "*.wsf", "*.svg", "*.csproj", "*.vcxproj", "*.fsproj"},
MimeTypes: []string{"text/xml", "application/xml", "image/svg+xml", "application/rss+xml", "application/atom+xml"},
DotAll: true,
},
diff --git a/vendor/github.com/alecthomas/chroma/lexers/z/zed.go b/vendor/github.com/alecthomas/chroma/lexers/z/zed.go
new file mode 100644
index 0000000..5479a2c
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/lexers/z/zed.go
@@ -0,0 +1,53 @@
+package z
+
+import (
+ "strings"
+
+ . "github.com/alecthomas/chroma" // nolint
+ "github.com/alecthomas/chroma/lexers/internal"
+)
+
+// Zed lexer.
+var Zed = internal.Register(MustNewLazyLexer(
+ &Config{
+ Name: "Zed",
+ Aliases: []string{"zed"},
+ Filenames: []string{"*.zed"},
+ MimeTypes: []string{"text/zed"},
+ },
+ zedRules,
+).SetAnalyser(func(text string) float32 {
+ if strings.Contains(text, "definition ") && strings.Contains(text, "relation ") && strings.Contains(text, "permission ") {
+ return 0.9
+ }
+ if strings.Contains(text, "definition ") {
+ return 0.5
+ }
+ if strings.Contains(text, "relation ") {
+ return 0.5
+ }
+ if strings.Contains(text, "permission ") {
+ return 0.25
+ }
+ return 0.0
+}))
+
+func zedRules() Rules {
+ return Rules{
+ "root": {
+ {`\n`, TextWhitespace, nil},
+ {`\s+`, TextWhitespace, nil},
+ {`//.*?\n`, CommentSingle, nil},
+ {`/(\\\n)?[*][\w\W]*?[*](\\\n)?/`, CommentMultiline, nil},
+ {`/(\\\n)?[*][\w\W]*`, CommentMultiline, nil},
+ {Words(``, `\b`, `definition`), KeywordType, nil},
+ {Words(``, `\b`, `relation`), KeywordNamespace, nil},
+ {Words(``, `\b`, `permission`), KeywordDeclaration, nil},
+ {`[a-zA-Z_]\w*/`, NameNamespace, nil},
+ {`[a-zA-Z_]\w*`, Name, nil},
+ {`#[a-zA-Z_]\w*`, NameVariable, nil},
+ {`[+%=><|^!?/\-*&~:]`, Operator, nil},
+ {`[{}()\[\],.;]`, Punctuation, nil},
+ },
+ }
+}
diff --git a/vendor/github.com/alecthomas/chroma/styles/witchhazel.go b/vendor/github.com/alecthomas/chroma/styles/witchhazel.go
new file mode 100644
index 0000000..4aea278
--- /dev/null
+++ b/vendor/github.com/alecthomas/chroma/styles/witchhazel.go
@@ -0,0 +1,52 @@
+// Copyright 2018 Alethea Katherine Flowers
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package styles
+
+import (
+ "github.com/alecthomas/chroma"
+)
+
+// WitchHazel Style
+var WitchHazel = Register(chroma.MustNewStyle("witchhazel", chroma.StyleEntries{
+ chroma.Text: "#F8F8F2",
+ chroma.Whitespace: "#A8757B",
+ chroma.Error: "#960050 bg:#1e0010",
+ chroma.Comment: "#b0bec5",
+ chroma.Keyword: "#C2FFDF",
+ chroma.KeywordNamespace: "#FFB8D1",
+ chroma.Operator: "#FFB8D1",
+ chroma.Punctuation: "#F8F8F2",
+ chroma.Name: "#F8F8F2",
+ chroma.NameAttribute: "#ceb1ff",
+ chroma.NameBuiltinPseudo: "#80cbc4",
+ chroma.NameClass: "#ceb1ff",
+ chroma.NameConstant: "#C5A3FF",
+ chroma.NameDecorator: "#ceb1ff",
+ chroma.NameException: "#ceb1ff",
+ chroma.NameFunction: "#ceb1ff",
+ chroma.NameProperty: "#F8F8F2",
+ chroma.NameTag: "#FFB8D1",
+ chroma.NameVariable: "#F8F8F2",
+ chroma.Number: "#C5A3FF",
+ chroma.Literal: "#ae81ff",
+ chroma.LiteralDate: "#e6db74",
+ chroma.String: "#1bc5e0",
+ chroma.GenericDeleted: "#f92672",
+ chroma.GenericEmph: "italic",
+ chroma.GenericInserted: "#a6e22e",
+ chroma.GenericStrong: "bold",
+ chroma.GenericSubheading: "#75715e",
+ chroma.Background: " bg:#433e56",
+}))
diff --git a/vendor/github.com/alecthomas/chroma/styles/xcode-dark.go b/vendor/github.com/alecthomas/chroma/styles/xcode-dark.go
index a16d946..9a9d757 100644
--- a/vendor/github.com/alecthomas/chroma/styles/xcode-dark.go
+++ b/vendor/github.com/alecthomas/chroma/styles/xcode-dark.go
@@ -21,7 +21,7 @@ var (
// Xcode dark style
var XcodeDark = Register(chroma.MustNewStyle("xcode-dark", chroma.StyleEntries{
- chroma.Background: plainText + " bg: " + background,
+ chroma.Background: plainText + " bg:" + background,
chroma.Comment: comments,
chroma.CommentMultiline: comments,
diff --git a/vendor/github.com/alecthomas/chroma/table.py b/vendor/github.com/alecthomas/chroma/table.py
old mode 100755
new mode 100644
diff --git a/vendor/github.com/alecthomas/chroma/tokentype_string.go b/vendor/github.com/alecthomas/chroma/tokentype_string.go
index 6fe3867..9c302f9 100644
--- a/vendor/github.com/alecthomas/chroma/tokentype_string.go
+++ b/vendor/github.com/alecthomas/chroma/tokentype_string.go
@@ -9,14 +9,17 @@ func _() {
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Background - -1]
- _ = x[LineNumbers - -2]
- _ = x[LineNumbersTable - -3]
- _ = x[LineHighlight - -4]
- _ = x[LineTable - -5]
- _ = x[LineTableTD - -6]
- _ = x[Error - -7]
- _ = x[Other - -8]
- _ = x[None - -9]
+ _ = x[PreWrapper - -2]
+ _ = x[Line - -3]
+ _ = x[LineNumbers - -4]
+ _ = x[LineNumbersTable - -5]
+ _ = x[LineHighlight - -6]
+ _ = x[LineTable - -7]
+ _ = x[LineTableTD - -8]
+ _ = x[CodeLine - -9]
+ _ = x[Error - -10]
+ _ = x[Other - -11]
+ _ = x[None - -12]
_ = x[EOFType-0]
_ = x[Keyword-1000]
_ = x[KeywordConstant-1001]
@@ -105,104 +108,107 @@ func _() {
_ = x[TextPunctuation-8003]
}
-const _TokenType_name = "NoneOtherErrorLineTableTDLineTableLineHighlightLineNumbersTableLineNumbersBackgroundEOFTypeKeywordKeywordConstantKeywordDeclarationKeywordNamespaceKeywordPseudoKeywordReservedKeywordTypeNameNameAttributeNameBuiltinNameBuiltinPseudoNameClassNameConstantNameDecoratorNameEntityNameExceptionNameFunctionNameFunctionMagicNameKeywordNameLabelNameNamespaceNameOperatorNameOtherNamePseudoNamePropertyNameTagNameVariableNameVariableAnonymousNameVariableClassNameVariableGlobalNameVariableInstanceNameVariableMagicLiteralLiteralDateLiteralOtherLiteralStringLiteralStringAffixLiteralStringAtomLiteralStringBacktickLiteralStringBooleanLiteralStringCharLiteralStringDelimiterLiteralStringDocLiteralStringDoubleLiteralStringEscapeLiteralStringHeredocLiteralStringInterpolLiteralStringNameLiteralStringOtherLiteralStringRegexLiteralStringSingleLiteralStringSymbolLiteralNumberLiteralNumberBinLiteralNumberFloatLiteralNumberHexLiteralNumberIntegerLiteralNumberIntegerLongLiteralNumberOctOperatorOperatorWordPunctuationCommentCommentHashbangCommentMultilineCommentSingleCommentSpecialCommentPreprocCommentPreprocFileGenericGenericDeletedGenericEmphGenericErrorGenericHeadingGenericInsertedGenericOutputGenericPromptGenericStrongGenericSubheadingGenericTracebackGenericUnderlineTextTextWhitespaceTextSymbolTextPunctuation"
+const _TokenType_name = "NoneOtherErrorCodeLineLineTableTDLineTableLineHighlightLineNumbersTableLineNumbersLinePreWrapperBackgroundEOFTypeKeywordKeywordConstantKeywordDeclarationKeywordNamespaceKeywordPseudoKeywordReservedKeywordTypeNameNameAttributeNameBuiltinNameBuiltinPseudoNameClassNameConstantNameDecoratorNameEntityNameExceptionNameFunctionNameFunctionMagicNameKeywordNameLabelNameNamespaceNameOperatorNameOtherNamePseudoNamePropertyNameTagNameVariableNameVariableAnonymousNameVariableClassNameVariableGlobalNameVariableInstanceNameVariableMagicLiteralLiteralDateLiteralOtherLiteralStringLiteralStringAffixLiteralStringAtomLiteralStringBacktickLiteralStringBooleanLiteralStringCharLiteralStringDelimiterLiteralStringDocLiteralStringDoubleLiteralStringEscapeLiteralStringHeredocLiteralStringInterpolLiteralStringNameLiteralStringOtherLiteralStringRegexLiteralStringSingleLiteralStringSymbolLiteralNumberLiteralNumberBinLiteralNumberFloatLiteralNumberHexLiteralNumberIntegerLiteralNumberIntegerLongLiteralNumberOctOperatorOperatorWordPunctuationCommentCommentHashbangCommentMultilineCommentSingleCommentSpecialCommentPreprocCommentPreprocFileGenericGenericDeletedGenericEmphGenericErrorGenericHeadingGenericInsertedGenericOutputGenericPromptGenericStrongGenericSubheadingGenericTracebackGenericUnderlineTextTextWhitespaceTextSymbolTextPunctuation"
var _TokenType_map = map[TokenType]string{
- -9: _TokenType_name[0:4],
- -8: _TokenType_name[4:9],
- -7: _TokenType_name[9:14],
- -6: _TokenType_name[14:25],
- -5: _TokenType_name[25:34],
- -4: _TokenType_name[34:47],
- -3: _TokenType_name[47:63],
- -2: _TokenType_name[63:74],
- -1: _TokenType_name[74:84],
- 0: _TokenType_name[84:91],
- 1000: _TokenType_name[91:98],
- 1001: _TokenType_name[98:113],
- 1002: _TokenType_name[113:131],
- 1003: _TokenType_name[131:147],
- 1004: _TokenType_name[147:160],
- 1005: _TokenType_name[160:175],
- 1006: _TokenType_name[175:186],
- 2000: _TokenType_name[186:190],
- 2001: _TokenType_name[190:203],
- 2002: _TokenType_name[203:214],
- 2003: _TokenType_name[214:231],
- 2004: _TokenType_name[231:240],
- 2005: _TokenType_name[240:252],
- 2006: _TokenType_name[252:265],
- 2007: _TokenType_name[265:275],
- 2008: _TokenType_name[275:288],
- 2009: _TokenType_name[288:300],
- 2010: _TokenType_name[300:317],
- 2011: _TokenType_name[317:328],
- 2012: _TokenType_name[328:337],
- 2013: _TokenType_name[337:350],
- 2014: _TokenType_name[350:362],
- 2015: _TokenType_name[362:371],
- 2016: _TokenType_name[371:381],
- 2017: _TokenType_name[381:393],
- 2018: _TokenType_name[393:400],
- 2019: _TokenType_name[400:412],
- 2020: _TokenType_name[412:433],
- 2021: _TokenType_name[433:450],
- 2022: _TokenType_name[450:468],
- 2023: _TokenType_name[468:488],
- 2024: _TokenType_name[488:505],
- 3000: _TokenType_name[505:512],
- 3001: _TokenType_name[512:523],
- 3002: _TokenType_name[523:535],
- 3100: _TokenType_name[535:548],
- 3101: _TokenType_name[548:566],
- 3102: _TokenType_name[566:583],
- 3103: _TokenType_name[583:604],
- 3104: _TokenType_name[604:624],
- 3105: _TokenType_name[624:641],
- 3106: _TokenType_name[641:663],
- 3107: _TokenType_name[663:679],
- 3108: _TokenType_name[679:698],
- 3109: _TokenType_name[698:717],
- 3110: _TokenType_name[717:737],
- 3111: _TokenType_name[737:758],
- 3112: _TokenType_name[758:775],
- 3113: _TokenType_name[775:793],
- 3114: _TokenType_name[793:811],
- 3115: _TokenType_name[811:830],
- 3116: _TokenType_name[830:849],
- 3200: _TokenType_name[849:862],
- 3201: _TokenType_name[862:878],
- 3202: _TokenType_name[878:896],
- 3203: _TokenType_name[896:912],
- 3204: _TokenType_name[912:932],
- 3205: _TokenType_name[932:956],
- 3206: _TokenType_name[956:972],
- 4000: _TokenType_name[972:980],
- 4001: _TokenType_name[980:992],
- 5000: _TokenType_name[992:1003],
- 6000: _TokenType_name[1003:1010],
- 6001: _TokenType_name[1010:1025],
- 6002: _TokenType_name[1025:1041],
- 6003: _TokenType_name[1041:1054],
- 6004: _TokenType_name[1054:1068],
- 6100: _TokenType_name[1068:1082],
- 6101: _TokenType_name[1082:1100],
- 7000: _TokenType_name[1100:1107],
- 7001: _TokenType_name[1107:1121],
- 7002: _TokenType_name[1121:1132],
- 7003: _TokenType_name[1132:1144],
- 7004: _TokenType_name[1144:1158],
- 7005: _TokenType_name[1158:1173],
- 7006: _TokenType_name[1173:1186],
- 7007: _TokenType_name[1186:1199],
- 7008: _TokenType_name[1199:1212],
- 7009: _TokenType_name[1212:1229],
- 7010: _TokenType_name[1229:1245],
- 7011: _TokenType_name[1245:1261],
- 8000: _TokenType_name[1261:1265],
- 8001: _TokenType_name[1265:1279],
- 8002: _TokenType_name[1279:1289],
- 8003: _TokenType_name[1289:1304],
+ -12: _TokenType_name[0:4],
+ -11: _TokenType_name[4:9],
+ -10: _TokenType_name[9:14],
+ -9: _TokenType_name[14:22],
+ -8: _TokenType_name[22:33],
+ -7: _TokenType_name[33:42],
+ -6: _TokenType_name[42:55],
+ -5: _TokenType_name[55:71],
+ -4: _TokenType_name[71:82],
+ -3: _TokenType_name[82:86],
+ -2: _TokenType_name[86:96],
+ -1: _TokenType_name[96:106],
+ 0: _TokenType_name[106:113],
+ 1000: _TokenType_name[113:120],
+ 1001: _TokenType_name[120:135],
+ 1002: _TokenType_name[135:153],
+ 1003: _TokenType_name[153:169],
+ 1004: _TokenType_name[169:182],
+ 1005: _TokenType_name[182:197],
+ 1006: _TokenType_name[197:208],
+ 2000: _TokenType_name[208:212],
+ 2001: _TokenType_name[212:225],
+ 2002: _TokenType_name[225:236],
+ 2003: _TokenType_name[236:253],
+ 2004: _TokenType_name[253:262],
+ 2005: _TokenType_name[262:274],
+ 2006: _TokenType_name[274:287],
+ 2007: _TokenType_name[287:297],
+ 2008: _TokenType_name[297:310],
+ 2009: _TokenType_name[310:322],
+ 2010: _TokenType_name[322:339],
+ 2011: _TokenType_name[339:350],
+ 2012: _TokenType_name[350:359],
+ 2013: _TokenType_name[359:372],
+ 2014: _TokenType_name[372:384],
+ 2015: _TokenType_name[384:393],
+ 2016: _TokenType_name[393:403],
+ 2017: _TokenType_name[403:415],
+ 2018: _TokenType_name[415:422],
+ 2019: _TokenType_name[422:434],
+ 2020: _TokenType_name[434:455],
+ 2021: _TokenType_name[455:472],
+ 2022: _TokenType_name[472:490],
+ 2023: _TokenType_name[490:510],
+ 2024: _TokenType_name[510:527],
+ 3000: _TokenType_name[527:534],
+ 3001: _TokenType_name[534:545],
+ 3002: _TokenType_name[545:557],
+ 3100: _TokenType_name[557:570],
+ 3101: _TokenType_name[570:588],
+ 3102: _TokenType_name[588:605],
+ 3103: _TokenType_name[605:626],
+ 3104: _TokenType_name[626:646],
+ 3105: _TokenType_name[646:663],
+ 3106: _TokenType_name[663:685],
+ 3107: _TokenType_name[685:701],
+ 3108: _TokenType_name[701:720],
+ 3109: _TokenType_name[720:739],
+ 3110: _TokenType_name[739:759],
+ 3111: _TokenType_name[759:780],
+ 3112: _TokenType_name[780:797],
+ 3113: _TokenType_name[797:815],
+ 3114: _TokenType_name[815:833],
+ 3115: _TokenType_name[833:852],
+ 3116: _TokenType_name[852:871],
+ 3200: _TokenType_name[871:884],
+ 3201: _TokenType_name[884:900],
+ 3202: _TokenType_name[900:918],
+ 3203: _TokenType_name[918:934],
+ 3204: _TokenType_name[934:954],
+ 3205: _TokenType_name[954:978],
+ 3206: _TokenType_name[978:994],
+ 4000: _TokenType_name[994:1002],
+ 4001: _TokenType_name[1002:1014],
+ 5000: _TokenType_name[1014:1025],
+ 6000: _TokenType_name[1025:1032],
+ 6001: _TokenType_name[1032:1047],
+ 6002: _TokenType_name[1047:1063],
+ 6003: _TokenType_name[1063:1076],
+ 6004: _TokenType_name[1076:1090],
+ 6100: _TokenType_name[1090:1104],
+ 6101: _TokenType_name[1104:1122],
+ 7000: _TokenType_name[1122:1129],
+ 7001: _TokenType_name[1129:1143],
+ 7002: _TokenType_name[1143:1154],
+ 7003: _TokenType_name[1154:1166],
+ 7004: _TokenType_name[1166:1180],
+ 7005: _TokenType_name[1180:1195],
+ 7006: _TokenType_name[1195:1208],
+ 7007: _TokenType_name[1208:1221],
+ 7008: _TokenType_name[1221:1234],
+ 7009: _TokenType_name[1234:1251],
+ 7010: _TokenType_name[1251:1267],
+ 7011: _TokenType_name[1267:1283],
+ 8000: _TokenType_name[1283:1287],
+ 8001: _TokenType_name[1287:1301],
+ 8002: _TokenType_name[1301:1311],
+ 8003: _TokenType_name[1311:1326],
}
func (i TokenType) String() string {
diff --git a/vendor/github.com/alecthomas/chroma/types.go b/vendor/github.com/alecthomas/chroma/types.go
index ede945c..3f15be8 100644
--- a/vendor/github.com/alecthomas/chroma/types.go
+++ b/vendor/github.com/alecthomas/chroma/types.go
@@ -38,6 +38,10 @@ func (t *TokenType) UnmarshalJSON(data []byte) error {
const (
// Default background style.
Background TokenType = -1 - iota
+ // PreWrapper style.
+ PreWrapper
+ // Line style.
+ Line
// Line numbers in output.
LineNumbers
// Line numbers in output when in table.
@@ -48,6 +52,8 @@ const (
LineTable
// Line numbers table TD wrapper style.
LineTableTD
+ // Code line wrapper style.
+ CodeLine
// Input that could not be tokenised.
Error
// Other is used by the Delegate lexer to indicate which tokens should be handled by the delegate.
@@ -219,12 +225,15 @@ const (
var (
StandardTypes = map[TokenType]string{
- Background: "chroma",
+ Background: "bg",
+ PreWrapper: "chroma",
+ Line: "line",
LineNumbers: "ln",
LineNumbersTable: "lnt",
LineHighlight: "hl",
LineTable: "lntable",
LineTableTD: "lntd",
+ CodeLine: "cl",
Text: "",
Whitespace: "w",
Error: "err",
diff --git a/vendor/github.com/dlclark/regexp2/.travis.yml b/vendor/github.com/dlclark/regexp2/.travis.yml
index 2aa5ea1..a2da6be 100644
--- a/vendor/github.com/dlclark/regexp2/.travis.yml
+++ b/vendor/github.com/dlclark/regexp2/.travis.yml
@@ -1,5 +1,7 @@
language: go
-
+arch:
+ - AMD64
+ - ppc64le
go:
- 1.9
- - tip
\ No newline at end of file
+ - tip
diff --git a/vendor/github.com/dlclark/regexp2/README.md b/vendor/github.com/dlclark/regexp2/README.md
index 4e4abb4..2caa94f 100644
--- a/vendor/github.com/dlclark/regexp2/README.md
+++ b/vendor/github.com/dlclark/regexp2/README.md
@@ -39,6 +39,24 @@ Group 0 is embedded in the Match. Group 0 is an automatically-assigned group th
The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`.
+If you want to find multiple matches from a single input string you should use the `FindNextMatch` method. For example, to implement a function similar to `regexp.FindAllString`:
+
+```go
+func regexp2FindAllString(re *regexp2.Regexp, s string) []string {
+ var matches []string
+ m, _ := re.FindStringMatch(s)
+ for m != nil {
+ matches = append(matches, m.String())
+ m, _ = re.FindNextMatch(m)
+ }
+ return matches
+}
+```
+
+`FindNextMatch` is optmized so that it re-uses the underlying string/rune slice.
+
+The internals of `regexp2` always operate on `[]rune` so `Index` and `Length` data in a `Match` always reference a position in `rune`s rather than `byte`s (even if the input was given as a string). This is a dramatic difference between `regexp` and `regexp2`. It's advisable to use the provided `String()` methods to avoid having to work with indices.
+
## Compare `regexp` and `regexp2`
| Category | regexp | regexp2 |
| --- | --- | --- |
@@ -62,6 +80,8 @@ The default behavior of `regexp2` is to match the .NET regexp engine, however th
* add support for named ascii character classes (e.g. `[[:foo:]]`)
* add support for python-style capture groups (e.g. `(Pre)`)
* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24))
+* change the character classes `\d` `\s` and `\w` to match the same characters as RE2. NOTE: if you also use the `ECMAScript` option then this will change the `\s` character class to match ECMAScript instead of RE2. ECMAScript allows more whitespace characters in `\s` than RE2 (but still fewer than the the default behavior).
+* allow character escape sequences to have defaults. For example, by default `\_` isn't a known character escape and will fail to compile, but in RE2 mode it will match the literal character `_`
```go
re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2)
@@ -72,6 +92,48 @@ if isMatch, _ := re.MatchString(`Something to match`); isMatch {
This feature is a work in progress and I'm open to ideas for more things to put here (maybe more relaxed character escaping rules?).
+## Catastrophic Backtracking and Timeouts
+
+`regexp2` supports features that can lead to catastrophic backtracking.
+`Regexp.MatchTimeout` can be set to to limit the impact of such behavior; the
+match will fail with an error after approximately MatchTimeout. No timeout
+checks are done by default.
+
+Timeout checking is not free. The current timeout checking implementation starts
+a background worker that updates a clock value approximately once every 100
+milliseconds. The matching code compares this value against the precomputed
+deadline for the match. The performance impact is as follows.
+
+1. A match with a timeout runs almost as fast as a match without a timeout.
+2. If any live matches have a timeout, there will be a background CPU load
+ (`~0.15%` currently on a modern machine). This load will remain constant
+ regardless of the number of matches done including matches done in parallel.
+3. If no live matches are using a timeout, the background load will remain
+ until the longest deadline (match timeout + the time when the match started)
+ is reached. E.g., if you set a timeout of one minute the load will persist
+ for approximately a minute even if the match finishes quickly.
+
+Some alternative implementations were considered and ruled out.
+
+1. **time.Now()** - This was the initial timeout implementation. It called `time.Now()`
+ and compared the result to the deadline approximately once every 1000 matching steps.
+ Adding a timeout to a simple match increased the cost from ~45ns to ~3000ns).
+2. **time.AfterFunc** - This approach entails using `time.AfterFunc` to set an `expired`
+ atomic boolean value. However it increases the cost of handling a simple match
+ with a timeout from ~45ns to ~360ns and was therefore ruled out.
+3. **counter** - In this approach an atomic variable tracks the number of live matches
+ with timeouts. The background clock stops when the counter hits zero. The benefit
+ of this approach is that the background load will stop more quickly (after the
+ last match has finished as opposed to waiting until the deadline for the last
+ match). However this approach requires more atomic variable updates and has poorer
+ performance when multiple matches are executed concurrently. (The cost of a
+ single match jumps from ~45ns to ~65ns, and the cost of running matches on
+ all 12 available CPUs jumps from ~400ns to ~730ns).
+
+## ECMAScript compatibility mode
+In this mode the engine provides compatibility with the [regex engine](https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects) described in the ECMAScript specification.
+
+Additionally a Unicode mode is provided which allows parsing of `\u{CodePoint}` syntax that is only when both are provided.
## Library features that I'm still working on
- Regex split
diff --git a/vendor/github.com/dlclark/regexp2/fastclock.go b/vendor/github.com/dlclark/regexp2/fastclock.go
new file mode 100644
index 0000000..4227eda
--- /dev/null
+++ b/vendor/github.com/dlclark/regexp2/fastclock.go
@@ -0,0 +1,104 @@
+package regexp2
+
+import (
+ "sync"
+ "sync/atomic"
+ "time"
+)
+
+// fasttime holds a time value (ticks since clock initialization)
+type fasttime int64
+
+// fastclock provides a fast clock implementation.
+//
+// A background goroutine periodically stores the current time
+// into an atomic variable.
+//
+// A deadline can be quickly checked for expiration by comparing
+// its value to the clock stored in the atomic variable.
+//
+// The goroutine automatically stops once clockEnd is reached.
+// (clockEnd covers the largest deadline seen so far + some
+// extra time). This ensures that if regexp2 with timeouts
+// stops being used we will stop background work.
+type fastclock struct {
+ // current and clockEnd can be read via atomic loads.
+ // Reads and writes of other fields require mu to be held.
+ mu sync.Mutex
+
+ start time.Time // Time corresponding to fasttime(0)
+ current atomicTime // Current time (approximate)
+ clockEnd atomicTime // When clock updater is supposed to stop (>= any existing deadline)
+ running bool // Is a clock updater running?
+}
+
+var fast fastclock
+
+// reached returns true if current time is at or past t.
+func (t fasttime) reached() bool {
+ return fast.current.read() >= t
+}
+
+// makeDeadline returns a time that is approximately time.Now().Add(d)
+func makeDeadline(d time.Duration) fasttime {
+ // Increase the deadline since the clock we are reading may be
+ // just about to tick forwards.
+ end := fast.current.read() + durationToTicks(d+clockPeriod)
+
+ // Start or extend clock if necessary.
+ if end > fast.clockEnd.read() {
+ extendClock(end)
+ }
+ return end
+}
+
+// extendClock ensures that clock is live and will run until at least end.
+func extendClock(end fasttime) {
+ fast.mu.Lock()
+ defer fast.mu.Unlock()
+
+ if fast.start.IsZero() {
+ fast.start = time.Now()
+ }
+
+ // Extend the running time to cover end as well as a bit of slop.
+ if shutdown := end + durationToTicks(time.Second); shutdown > fast.clockEnd.read() {
+ fast.clockEnd.write(shutdown)
+ }
+
+ // Start clock if necessary
+ if !fast.running {
+ fast.running = true
+ go runClock()
+ }
+}
+
+func durationToTicks(d time.Duration) fasttime {
+ // Downscale nanoseconds to approximately a millisecond so that we can avoid
+ // overflow even if the caller passes in math.MaxInt64.
+ return fasttime(d) >> 20
+}
+
+// clockPeriod is the approximate interval between updates of approximateClock.
+const clockPeriod = 100 * time.Millisecond
+
+func runClock() {
+ fast.mu.Lock()
+ defer fast.mu.Unlock()
+
+ for fast.current.read() <= fast.clockEnd.read() {
+ // Unlock while sleeping.
+ fast.mu.Unlock()
+ time.Sleep(clockPeriod)
+ fast.mu.Lock()
+
+ newTime := durationToTicks(time.Since(fast.start))
+ fast.current.write(newTime)
+ }
+ fast.running = false
+}
+
+type atomicTime struct{ v int64 } // Should change to atomic.Int64 when we can use go 1.19
+
+func (t *atomicTime) read() fasttime { return fasttime(atomic.LoadInt64(&t.v)) }
+func (t *atomicTime) write(v fasttime) { atomic.StoreInt64(&t.v, int64(v)) }
diff --git a/vendor/github.com/dlclark/regexp2/regexp.go b/vendor/github.com/dlclark/regexp2/regexp.go
index 7c7b01d..9d41c76 100644
--- a/vendor/github.com/dlclark/regexp2/regexp.go
+++ b/vendor/github.com/dlclark/regexp2/regexp.go
@@ -24,7 +24,11 @@ var DefaultMatchTimeout = time.Duration(math.MaxInt64)
// Regexp is the representation of a compiled regular expression.
// A Regexp is safe for concurrent use by multiple goroutines.
type Regexp struct {
- //timeout when trying to find matches
+ // A match will time out if it takes (approximately) more than
+ // MatchTimeout. This is a safety check in case the match
+ // encounters catastrophic backtracking. The default value
+ // (DefaultMatchTimeout) causes all time out checking to be
+ // suppressed.
MatchTimeout time.Duration
// read-only after Compile
@@ -121,6 +125,7 @@ const (
Debug = 0x0080 // "d"
ECMAScript = 0x0100 // "e"
RE2 = 0x0200 // RE2 (regexp package) compatibility mode
+ Unicode = 0x0400 // "u"
)
func (re *Regexp) RightToLeft() bool {
diff --git a/vendor/github.com/dlclark/regexp2/runner.go b/vendor/github.com/dlclark/regexp2/runner.go
index 4d7f9b0..494dcef 100644
--- a/vendor/github.com/dlclark/regexp2/runner.go
+++ b/vendor/github.com/dlclark/regexp2/runner.go
@@ -58,10 +58,9 @@ type runner struct {
runmatch *Match // result object
- ignoreTimeout bool
- timeout time.Duration // timeout in milliseconds (needed for actual)
- timeoutChecksToSkip int
- timeoutAt time.Time
+ ignoreTimeout bool
+ timeout time.Duration // timeout in milliseconds (needed for actual)
+ deadline fasttime
operator syntax.InstOp
codepos int
@@ -1551,39 +1550,15 @@ func (r *runner) isECMABoundary(index, startpos, endpos int) bool {
(index < endpos && syntax.IsECMAWordChar(r.runtext[index]))
}
-// this seems like a comment to justify randomly picking 1000 :-P
-// We have determined this value in a series of experiments where x86 retail
-// builds (ono-lab-optimized) were run on different pattern/input pairs. Larger values
-// of TimeoutCheckFrequency did not tend to increase performance; smaller values
-// of TimeoutCheckFrequency tended to slow down the execution.
-const timeoutCheckFrequency int = 1000
-
func (r *runner) startTimeoutWatch() {
if r.ignoreTimeout {
return
}
-
- r.timeoutChecksToSkip = timeoutCheckFrequency
- r.timeoutAt = time.Now().Add(r.timeout)
+ r.deadline = makeDeadline(r.timeout)
}
func (r *runner) checkTimeout() error {
- if r.ignoreTimeout {
- return nil
- }
- r.timeoutChecksToSkip--
- if r.timeoutChecksToSkip != 0 {
- return nil
- }
-
- r.timeoutChecksToSkip = timeoutCheckFrequency
- return r.doCheckTimeout()
-}
-
-func (r *runner) doCheckTimeout() error {
- current := time.Now()
-
- if current.Before(r.timeoutAt) {
+ if r.ignoreTimeout || !r.deadline.reached() {
return nil
}
diff --git a/vendor/github.com/dlclark/regexp2/syntax/charclass.go b/vendor/github.com/dlclark/regexp2/syntax/charclass.go
index 53974d1..6881a0e 100644
--- a/vendor/github.com/dlclark/regexp2/syntax/charclass.go
+++ b/vendor/github.com/dlclark/regexp2/syntax/charclass.go
@@ -37,6 +37,8 @@ var (
ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00}
ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b}
ecmaDigit = []rune{0x0030, 0x003a}
+
+ re2Space = []rune{0x0009, 0x000b, 0x000c, 0x000e, 0x0020, 0x0021}
)
var (
@@ -56,6 +58,9 @@ var (
NotSpaceClass = getCharSetFromCategoryString(true, false, spaceCategoryText)
DigitClass = getCharSetFromCategoryString(false, false, "Nd")
NotDigitClass = getCharSetFromCategoryString(false, true, "Nd")
+
+ RE2SpaceClass = getCharSetFromOldString(re2Space, false)
+ NotRE2SpaceClass = getCharSetFromOldString(re2Space, true)
)
var unicodeCategories = func() map[string]*unicode.RangeTable {
@@ -401,13 +406,19 @@ func (c *CharSet) addChar(ch rune) {
c.addRange(ch, ch)
}
-func (c *CharSet) addSpace(ecma, negate bool) {
+func (c *CharSet) addSpace(ecma, re2, negate bool) {
if ecma {
if negate {
c.addRanges(NotECMASpaceClass().ranges)
} else {
c.addRanges(ECMASpaceClass().ranges)
}
+ } else if re2 {
+ if negate {
+ c.addRanges(NotRE2SpaceClass().ranges)
+ } else {
+ c.addRanges(RE2SpaceClass().ranges)
+ }
} else {
c.addCategories(category{cat: spaceCategoryText, negate: negate})
}
@@ -563,7 +574,7 @@ func (c *CharSet) addNamedASCII(name string, negate bool) bool {
case "punct": //[!-/:-@[-`{-~]
rs = []singleRange{singleRange{'!', '/'}, singleRange{':', '@'}, singleRange{'[', '`'}, singleRange{'{', '~'}}
case "space":
- c.addSpace(true, negate)
+ c.addSpace(true, false, negate)
case "upper":
rs = []singleRange{singleRange{'A', 'Z'}}
case "word":
diff --git a/vendor/github.com/dlclark/regexp2/syntax/parser.go b/vendor/github.com/dlclark/regexp2/syntax/parser.go
index da14f98..9dc6e31 100644
--- a/vendor/github.com/dlclark/regexp2/syntax/parser.go
+++ b/vendor/github.com/dlclark/regexp2/syntax/parser.go
@@ -22,6 +22,7 @@ const (
Debug = 0x0080 // "d"
ECMAScript = 0x0100 // "e"
RE2 = 0x0200 // RE2 compat mode
+ Unicode = 0x0400 // "u"
)
func optionFromCode(ch rune) RegexOptions {
@@ -43,6 +44,8 @@ func optionFromCode(ch rune) RegexOptions {
return Debug
case 'e', 'E':
return ECMAScript
+ case 'u', 'U':
+ return Unicode
default:
return 0
}
@@ -104,7 +107,7 @@ const (
ErrBadClassInCharRange = "cannot include class \\%v in character range"
ErrUnterminatedBracket = "unterminated [] set"
ErrSubtractionMustBeLast = "a subtraction must be the last element in a character class"
- ErrReversedCharRange = "[x-y] range in reverse order"
+ ErrReversedCharRange = "[%c-%c] range in reverse order"
)
func (e ErrorCode) String() string {
@@ -1121,14 +1124,14 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
case 'w':
p.moveRight(1)
- if p.useOptionE() {
+ if p.useOptionE() || p.useRE2() {
return newRegexNodeSet(ntSet, p.options, ECMAWordClass()), nil
}
return newRegexNodeSet(ntSet, p.options, WordClass()), nil
case 'W':
p.moveRight(1)
- if p.useOptionE() {
+ if p.useOptionE() || p.useRE2() {
return newRegexNodeSet(ntSet, p.options, NotECMAWordClass()), nil
}
return newRegexNodeSet(ntSet, p.options, NotWordClass()), nil
@@ -1137,6 +1140,8 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
p.moveRight(1)
if p.useOptionE() {
return newRegexNodeSet(ntSet, p.options, ECMASpaceClass()), nil
+ } else if p.useRE2() {
+ return newRegexNodeSet(ntSet, p.options, RE2SpaceClass()), nil
}
return newRegexNodeSet(ntSet, p.options, SpaceClass()), nil
@@ -1144,19 +1149,21 @@ func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) {
p.moveRight(1)
if p.useOptionE() {
return newRegexNodeSet(ntSet, p.options, NotECMASpaceClass()), nil
+ } else if p.useRE2() {
+ return newRegexNodeSet(ntSet, p.options, NotRE2SpaceClass()), nil
}
return newRegexNodeSet(ntSet, p.options, NotSpaceClass()), nil
case 'd':
p.moveRight(1)
- if p.useOptionE() {
+ if p.useOptionE() || p.useRE2() {
return newRegexNodeSet(ntSet, p.options, ECMADigitClass()), nil
}
return newRegexNodeSet(ntSet, p.options, DigitClass()), nil
case 'D':
p.moveRight(1)
- if p.useOptionE() {
+ if p.useOptionE() || p.useRE2() {
return newRegexNodeSet(ntSet, p.options, NotECMADigitClass()), nil
}
return newRegexNodeSet(ntSet, p.options, NotDigitClass()), nil
@@ -1186,19 +1193,24 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
return nil, p.getErr(ErrIllegalEndEscape)
}
angled := false
+ k := false
close := '\x00'
backpos := p.textpos()
ch := p.rightChar(0)
- // allow \k instead of \, which is now deprecated
+ // Allow \k instead of \, which is now deprecated.
- if ch == 'k' {
+ // According to ECMAScript specification, \k is only parsed as a named group reference if
+ // there is at least one group name in the regexp.
+ // See https://www.ecma-international.org/ecma-262/#sec-isvalidregularexpressionliteral, step 7.
+ // Note, during the first (scanOnly) run we may not have all group names scanned, but that's ok.
+ if ch == 'k' && (!p.useOptionE() || len(p.capnames) > 0) {
if p.charsRight() >= 2 {
p.moveRight(1)
ch = p.moveRightGetChar()
- if ch == '<' || ch == '\'' {
+ if ch == '<' || (!p.useOptionE() && ch == '\'') { // No support for \k'name' in ECMAScript
angled = true
if ch == '\'' {
close = '\''
@@ -1213,8 +1225,9 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
}
ch = p.rightChar(0)
+ k = true
- } else if (ch == '<' || ch == '\'') && p.charsRight() > 1 { // Note angle without \g
+ } else if !p.useOptionE() && (ch == '<' || ch == '\'') && p.charsRight() > 1 { // Note angle without \g
angled = true
if ch == '\'' {
close = '\''
@@ -1257,14 +1270,23 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
return nil, p.getErr(ErrUndefinedBackRef, capnum)
}
- } else if angled && IsWordChar(ch) {
+ } else if angled {
capname := p.scanCapname()
- if p.charsRight() > 0 && p.moveRightGetChar() == close {
+ if capname != "" && p.charsRight() > 0 && p.moveRightGetChar() == close {
+
+ if scanOnly {
+ return nil, nil
+ }
+
if p.isCaptureName(capname) {
return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil
}
return nil, p.getErr(ErrUndefinedNameRef, capname)
+ } else {
+ if k {
+ return nil, p.getErr(ErrMalformedNameRef)
+ }
}
}
@@ -1276,6 +1298,10 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) {
return nil, err
}
+ if scanOnly {
+ return nil, nil
+ }
+
if p.useOptionI() {
ch = unicode.ToLower(ch)
}
@@ -1443,7 +1469,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
if inRange {
return nil, p.getErr(ErrBadClassInCharRange, ch)
}
- cc.addDigit(p.useOptionE(), ch == 'D', p.patternRaw)
+ cc.addDigit(p.useOptionE() || p.useRE2(), ch == 'D', p.patternRaw)
}
continue
@@ -1452,7 +1478,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
if inRange {
return nil, p.getErr(ErrBadClassInCharRange, ch)
}
- cc.addSpace(p.useOptionE(), ch == 'S')
+ cc.addSpace(p.useOptionE(), p.useRE2(), ch == 'S')
}
continue
@@ -1462,7 +1488,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
return nil, p.getErr(ErrBadClassInCharRange, ch)
}
- cc.addWord(p.useOptionE(), ch == 'W')
+ cc.addWord(p.useOptionE() || p.useRE2(), ch == 'W')
}
continue
@@ -1548,7 +1574,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) {
} else {
// a regular range, like a-z
if chPrev > ch {
- return nil, p.getErr(ErrReversedCharRange)
+ return nil, p.getErr(ErrReversedCharRange, chPrev, ch)
}
cc.addRange(chPrev, ch)
}
@@ -1672,7 +1698,13 @@ func (p *parser) scanCharEscape() (r rune, err error) {
r, err = p.scanHex(2)
}
case 'u':
- r, err = p.scanHex(4)
+ // ECMAscript suppot \u{HEX} only if `u` is also set
+ if p.useOptionE() && p.useOptionU() && p.charsRight() > 0 && p.rightChar(0) == '{' {
+ p.moveRight(1)
+ return p.scanHexUntilBrace()
+ } else {
+ r, err = p.scanHex(4)
+ }
case 'a':
return '\u0007', nil
case 'b':
@@ -1692,7 +1724,7 @@ func (p *parser) scanCharEscape() (r rune, err error) {
case 'c':
r, err = p.scanControl()
default:
- if !p.useOptionE() && IsWordChar(ch) {
+ if !p.useOptionE() && !p.useRE2() && IsWordChar(ch) {
return 0, p.getErr(ErrUnrecognizedEscape, string(ch))
}
return ch, nil
@@ -1949,6 +1981,11 @@ func (p *parser) useRE2() bool {
return (p.options & RE2) != 0
}
+// True if U option enabling ECMAScript's Unicode behavior on.
+func (p *parser) useOptionU() bool {
+ return (p.options & Unicode) != 0
+}
+
// True if options stack is empty.
func (p *parser) emptyOptionsStack() bool {
return len(p.optionsStack) == 0
@@ -2044,7 +2081,8 @@ func (p *parser) addToConcatenate(pos, cch int, isReplacement bool) {
}
if cch > 1 {
- str := p.pattern[pos : pos+cch]
+ str := make([]rune, cch)
+ copy(str, p.pattern[pos:pos+cch])
if p.useOptionI() && !isReplacement {
// We do the ToLower character by character for consistency. With surrogate chars, doing
diff --git a/vendor/github.com/dlclark/regexp2/syntax/prefix.go b/vendor/github.com/dlclark/regexp2/syntax/prefix.go
index 011ef0b..f671688 100644
--- a/vendor/github.com/dlclark/regexp2/syntax/prefix.go
+++ b/vendor/github.com/dlclark/regexp2/syntax/prefix.go
@@ -712,7 +712,7 @@ func (b *BmPrefix) Scan(text []rune, index, beglimit, endlimit int) int {
if chTest != b.pattern[match] {
advance = b.positive[match]
- if (chTest & 0xFF80) == 0 {
+ if chTest < 128 {
test2 = (match - startmatch) + b.negativeASCII[chTest]
} else if chTest < 0xffff && len(b.negativeUnicode) > 0 {
unicodeLookup = b.negativeUnicode[chTest>>8]
diff --git a/vendor/golang.org/x/sys/AUTHORS b/vendor/golang.org/x/sys/AUTHORS
deleted file mode 100644
index 15167cd..0000000
--- a/vendor/golang.org/x/sys/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code refers to The Go Authors for copyright purposes.
-# The master list of authors is in the main Go distribution,
-# visible at http://tip.golang.org/AUTHORS.
diff --git a/vendor/golang.org/x/sys/CONTRIBUTORS b/vendor/golang.org/x/sys/CONTRIBUTORS
deleted file mode 100644
index 1c4577e..0000000
--- a/vendor/golang.org/x/sys/CONTRIBUTORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code was written by the Go contributors.
-# The master list of contributors is in the main Go distribution,
-# visible at http://tip.golang.org/CONTRIBUTORS.
diff --git a/vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go b/vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go
deleted file mode 100644
index e07899b..0000000
--- a/vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2020 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 unsafeheader contains header declarations for the Go runtime's
-// slice and string implementations.
-//
-// This package allows x/sys to use types equivalent to
-// reflect.SliceHeader and reflect.StringHeader without introducing
-// a dependency on the (relatively heavy) "reflect" package.
-package unsafeheader
-
-import (
- "unsafe"
-)
-
-// Slice is the runtime representation of a slice.
-// It cannot be used safely or portably and its representation may change in a later release.
-type Slice struct {
- Data unsafe.Pointer
- Len int
- Cap int
-}
-
-// String is the runtime representation of a string.
-// It cannot be used safely or portably and its representation may change in a later release.
-type String struct {
- Data unsafe.Pointer
- Len int
-}
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s b/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
new file mode 100644
index 0000000..e5b9a84
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s
@@ -0,0 +1,31 @@
+// Copyright 2022 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.
+
+//go:build (darwin || freebsd || netbsd || openbsd) && gc
+// +build darwin freebsd netbsd openbsd
+// +build gc
+
+#include "textflag.h"
+
+//
+// System call support for ppc64, BSD
+//
+
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
+
+TEXT ·Syscall(SB),NOSPLIT,$0-56
+ JMP syscall·Syscall(SB)
+
+TEXT ·Syscall6(SB),NOSPLIT,$0-80
+ JMP syscall·Syscall6(SB)
+
+TEXT ·Syscall9(SB),NOSPLIT,$0-104
+ JMP syscall·Syscall9(SB)
+
+TEXT ·RawSyscall(SB),NOSPLIT,$0-56
+ JMP syscall·RawSyscall(SB)
+
+TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
+ JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s b/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
new file mode 100644
index 0000000..d560019
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s
@@ -0,0 +1,29 @@
+// Copyright 2021 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+//go:build (darwin || freebsd || netbsd || openbsd) && gc
+// +build darwin freebsd netbsd openbsd
+// +build gc
+
+#include "textflag.h"
+
+// System call support for RISCV64 BSD
+
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
+
+TEXT ·Syscall(SB),NOSPLIT,$0-56
+ JMP syscall·Syscall(SB)
+
+TEXT ·Syscall6(SB),NOSPLIT,$0-80
+ JMP syscall·Syscall6(SB)
+
+TEXT ·Syscall9(SB),NOSPLIT,$0-104
+ JMP syscall·Syscall9(SB)
+
+TEXT ·RawSyscall(SB),NOSPLIT,$0-56
+ JMP syscall·RawSyscall(SB)
+
+TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
+ JMP syscall·RawSyscall6(SB)
diff --git a/vendor/golang.org/x/sys/unix/asm_linux_loong64.s b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s
new file mode 100644
index 0000000..5653572
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/asm_linux_loong64.s
@@ -0,0 +1,54 @@
+// Copyright 2022 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.
+
+//go:build linux && loong64 && gc
+// +build linux
+// +build loong64
+// +build gc
+
+#include "textflag.h"
+
+
+// Just jump to package syscall's implementation for all these functions.
+// The runtime may know about them.
+
+TEXT ·Syscall(SB),NOSPLIT,$0-56
+ JMP syscall·Syscall(SB)
+
+TEXT ·Syscall6(SB),NOSPLIT,$0-80
+ JMP syscall·Syscall6(SB)
+
+TEXT ·SyscallNoError(SB),NOSPLIT,$0-48
+ JAL runtime·entersyscall(SB)
+ MOVV a1+8(FP), R4
+ MOVV a2+16(FP), R5
+ MOVV a3+24(FP), R6
+ MOVV R0, R7
+ MOVV R0, R8
+ MOVV R0, R9
+ MOVV trap+0(FP), R11 // syscall entry
+ SYSCALL
+ MOVV R4, r1+32(FP)
+ MOVV R0, r2+40(FP) // r2 is not used. Always set to 0
+ JAL runtime·exitsyscall(SB)
+ RET
+
+TEXT ·RawSyscall(SB),NOSPLIT,$0-56
+ JMP syscall·RawSyscall(SB)
+
+TEXT ·RawSyscall6(SB),NOSPLIT,$0-80
+ JMP syscall·RawSyscall6(SB)
+
+TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48
+ MOVV a1+8(FP), R4
+ MOVV a2+16(FP), R5
+ MOVV a3+24(FP), R6
+ MOVV R0, R7
+ MOVV R0, R8
+ MOVV R0, R9
+ MOVV trap+0(FP), R11 // syscall entry
+ SYSCALL
+ MOVV R4, r1+32(FP)
+ MOVV R0, r2+40(FP) // r2 is not used. Always set to 0
+ RET
diff --git a/vendor/golang.org/x/sys/unix/dirent.go b/vendor/golang.org/x/sys/unix/dirent.go
index e74e5ea..2499f97 100644
--- a/vendor/golang.org/x/sys/unix/dirent.go
+++ b/vendor/golang.org/x/sys/unix/dirent.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
+// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
diff --git a/vendor/golang.org/x/sys/unix/endian_little.go b/vendor/golang.org/x/sys/unix/endian_little.go
index 4362f47..b0f2bc4 100644
--- a/vendor/golang.org/x/sys/unix/endian_little.go
+++ b/vendor/golang.org/x/sys/unix/endian_little.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
-//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
-// +build 386 amd64 amd64p32 alpha arm arm64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
+//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
+// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
package unix
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go b/vendor/golang.org/x/sys/unix/errors_freebsd_386.go
deleted file mode 100644
index 761db66..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_386.go
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright 2017 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.
-
-// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
-// them here for backwards compatibility.
-
-package unix
-
-const (
- DLT_HHDLC = 0x79
- IFF_SMART = 0x20
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAITH = 0xf2
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_IPXIP = 0xf9
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IPV6_MIN_MEMBERSHIPS = 0x1f
- IP_FAITH = 0x16
- IP_MAX_SOURCE_FILTER = 0x400
- IP_MIN_MEMBERSHIPS = 0x1f
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- RT_CACHING_CONTEXT = 0x1
- RT_NORTREF = 0x2
- SIOCADDRT = 0x8030720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8030720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
deleted file mode 100644
index 070f44b..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_amd64.go
+++ /dev/null
@@ -1,233 +0,0 @@
-// Copyright 2017 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.
-
-// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
-// them here for backwards compatibility.
-
-package unix
-
-const (
- DLT_HHDLC = 0x79
- IFF_SMART = 0x20
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAITH = 0xf2
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_IPXIP = 0xf9
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IPV6_MIN_MEMBERSHIPS = 0x1f
- IP_FAITH = 0x16
- IP_MAX_SOURCE_FILTER = 0x400
- IP_MIN_MEMBERSHIPS = 0x1f
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- RT_CACHING_CONTEXT = 0x1
- RT_NORTREF = 0x2
- SIOCADDRT = 0x8040720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8040720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go b/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
deleted file mode 100644
index 856dca3..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_arm.go
+++ /dev/null
@@ -1,226 +0,0 @@
-// Copyright 2017 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 unix
-
-const (
- IFT_1822 = 0x2
- IFT_A12MPPSWITCH = 0x82
- IFT_AAL2 = 0xbb
- IFT_AAL5 = 0x31
- IFT_ADSL = 0x5e
- IFT_AFLANE8023 = 0x3b
- IFT_AFLANE8025 = 0x3c
- IFT_ARAP = 0x58
- IFT_ARCNET = 0x23
- IFT_ARCNETPLUS = 0x24
- IFT_ASYNC = 0x54
- IFT_ATM = 0x25
- IFT_ATMDXI = 0x69
- IFT_ATMFUNI = 0x6a
- IFT_ATMIMA = 0x6b
- IFT_ATMLOGICAL = 0x50
- IFT_ATMRADIO = 0xbd
- IFT_ATMSUBINTERFACE = 0x86
- IFT_ATMVCIENDPT = 0xc2
- IFT_ATMVIRTUAL = 0x95
- IFT_BGPPOLICYACCOUNTING = 0xa2
- IFT_BSC = 0x53
- IFT_CCTEMUL = 0x3d
- IFT_CEPT = 0x13
- IFT_CES = 0x85
- IFT_CHANNEL = 0x46
- IFT_CNR = 0x55
- IFT_COFFEE = 0x84
- IFT_COMPOSITELINK = 0x9b
- IFT_DCN = 0x8d
- IFT_DIGITALPOWERLINE = 0x8a
- IFT_DIGITALWRAPPEROVERHEADCHANNEL = 0xba
- IFT_DLSW = 0x4a
- IFT_DOCSCABLEDOWNSTREAM = 0x80
- IFT_DOCSCABLEMACLAYER = 0x7f
- IFT_DOCSCABLEUPSTREAM = 0x81
- IFT_DS0 = 0x51
- IFT_DS0BUNDLE = 0x52
- IFT_DS1FDL = 0xaa
- IFT_DS3 = 0x1e
- IFT_DTM = 0x8c
- IFT_DVBASILN = 0xac
- IFT_DVBASIOUT = 0xad
- IFT_DVBRCCDOWNSTREAM = 0x93
- IFT_DVBRCCMACLAYER = 0x92
- IFT_DVBRCCUPSTREAM = 0x94
- IFT_ENC = 0xf4
- IFT_EON = 0x19
- IFT_EPLRS = 0x57
- IFT_ESCON = 0x49
- IFT_ETHER = 0x6
- IFT_FAST = 0x7d
- IFT_FASTETHER = 0x3e
- IFT_FASTETHERFX = 0x45
- IFT_FDDI = 0xf
- IFT_FIBRECHANNEL = 0x38
- IFT_FRAMERELAYINTERCONNECT = 0x3a
- IFT_FRAMERELAYMPI = 0x5c
- IFT_FRDLCIENDPT = 0xc1
- IFT_FRELAY = 0x20
- IFT_FRELAYDCE = 0x2c
- IFT_FRF16MFRBUNDLE = 0xa3
- IFT_FRFORWARD = 0x9e
- IFT_G703AT2MB = 0x43
- IFT_G703AT64K = 0x42
- IFT_GIF = 0xf0
- IFT_GIGABITETHERNET = 0x75
- IFT_GR303IDT = 0xb2
- IFT_GR303RDT = 0xb1
- IFT_H323GATEKEEPER = 0xa4
- IFT_H323PROXY = 0xa5
- IFT_HDH1822 = 0x3
- IFT_HDLC = 0x76
- IFT_HDSL2 = 0xa8
- IFT_HIPERLAN2 = 0xb7
- IFT_HIPPI = 0x2f
- IFT_HIPPIINTERFACE = 0x39
- IFT_HOSTPAD = 0x5a
- IFT_HSSI = 0x2e
- IFT_HY = 0xe
- IFT_IBM370PARCHAN = 0x48
- IFT_IDSL = 0x9a
- IFT_IEEE80211 = 0x47
- IFT_IEEE80212 = 0x37
- IFT_IEEE8023ADLAG = 0xa1
- IFT_IFGSN = 0x91
- IFT_IMT = 0xbe
- IFT_INTERLEAVE = 0x7c
- IFT_IP = 0x7e
- IFT_IPFORWARD = 0x8e
- IFT_IPOVERATM = 0x72
- IFT_IPOVERCDLC = 0x6d
- IFT_IPOVERCLAW = 0x6e
- IFT_IPSWITCH = 0x4e
- IFT_ISDN = 0x3f
- IFT_ISDNBASIC = 0x14
- IFT_ISDNPRIMARY = 0x15
- IFT_ISDNS = 0x4b
- IFT_ISDNU = 0x4c
- IFT_ISO88022LLC = 0x29
- IFT_ISO88023 = 0x7
- IFT_ISO88024 = 0x8
- IFT_ISO88025 = 0x9
- IFT_ISO88025CRFPINT = 0x62
- IFT_ISO88025DTR = 0x56
- IFT_ISO88025FIBER = 0x73
- IFT_ISO88026 = 0xa
- IFT_ISUP = 0xb3
- IFT_L3IPXVLAN = 0x89
- IFT_LAPB = 0x10
- IFT_LAPD = 0x4d
- IFT_LAPF = 0x77
- IFT_LOCALTALK = 0x2a
- IFT_LOOP = 0x18
- IFT_MEDIAMAILOVERIP = 0x8b
- IFT_MFSIGLINK = 0xa7
- IFT_MIOX25 = 0x26
- IFT_MODEM = 0x30
- IFT_MPC = 0x71
- IFT_MPLS = 0xa6
- IFT_MPLSTUNNEL = 0x96
- IFT_MSDSL = 0x8f
- IFT_MVL = 0xbf
- IFT_MYRINET = 0x63
- IFT_NFAS = 0xaf
- IFT_NSIP = 0x1b
- IFT_OPTICALCHANNEL = 0xc3
- IFT_OPTICALTRANSPORT = 0xc4
- IFT_OTHER = 0x1
- IFT_P10 = 0xc
- IFT_P80 = 0xd
- IFT_PARA = 0x22
- IFT_PFLOG = 0xf6
- IFT_PFSYNC = 0xf7
- IFT_PLC = 0xae
- IFT_POS = 0xab
- IFT_PPPMULTILINKBUNDLE = 0x6c
- IFT_PROPBWAP2MP = 0xb8
- IFT_PROPCNLS = 0x59
- IFT_PROPDOCSWIRELESSDOWNSTREAM = 0xb5
- IFT_PROPDOCSWIRELESSMACLAYER = 0xb4
- IFT_PROPDOCSWIRELESSUPSTREAM = 0xb6
- IFT_PROPMUX = 0x36
- IFT_PROPWIRELESSP2P = 0x9d
- IFT_PTPSERIAL = 0x16
- IFT_PVC = 0xf1
- IFT_QLLC = 0x44
- IFT_RADIOMAC = 0xbc
- IFT_RADSL = 0x5f
- IFT_REACHDSL = 0xc0
- IFT_RFC1483 = 0x9f
- IFT_RS232 = 0x21
- IFT_RSRB = 0x4f
- IFT_SDLC = 0x11
- IFT_SDSL = 0x60
- IFT_SHDSL = 0xa9
- IFT_SIP = 0x1f
- IFT_SLIP = 0x1c
- IFT_SMDSDXI = 0x2b
- IFT_SMDSICIP = 0x34
- IFT_SONET = 0x27
- IFT_SONETOVERHEADCHANNEL = 0xb9
- IFT_SONETPATH = 0x32
- IFT_SONETVT = 0x33
- IFT_SRP = 0x97
- IFT_SS7SIGLINK = 0x9c
- IFT_STACKTOSTACK = 0x6f
- IFT_STARLAN = 0xb
- IFT_STF = 0xd7
- IFT_T1 = 0x12
- IFT_TDLC = 0x74
- IFT_TERMPAD = 0x5b
- IFT_TR008 = 0xb0
- IFT_TRANSPHDLC = 0x7b
- IFT_TUNNEL = 0x83
- IFT_ULTRA = 0x1d
- IFT_USB = 0xa0
- IFT_V11 = 0x40
- IFT_V35 = 0x2d
- IFT_V36 = 0x41
- IFT_V37 = 0x78
- IFT_VDSL = 0x61
- IFT_VIRTUALIPADDRESS = 0x70
- IFT_VOICEEM = 0x64
- IFT_VOICEENCAP = 0x67
- IFT_VOICEFXO = 0x65
- IFT_VOICEFXS = 0x66
- IFT_VOICEOVERATM = 0x98
- IFT_VOICEOVERFRAMERELAY = 0x99
- IFT_VOICEOVERIP = 0x68
- IFT_X213 = 0x5d
- IFT_X25 = 0x5
- IFT_X25DDN = 0x4
- IFT_X25HUNTGROUP = 0x7a
- IFT_X25MLP = 0x79
- IFT_X25PLE = 0x28
- IFT_XETHER = 0x1a
-
- // missing constants on FreeBSD-11.1-RELEASE, copied from old values in ztypes_freebsd_arm.go
- IFF_SMART = 0x20
- IFT_FAITH = 0xf2
- IFT_IPXIP = 0xf9
- IPPROTO_MAXID = 0x34
- IPV6_FAITH = 0x1d
- IP_FAITH = 0x16
- MAP_NORESERVE = 0x40
- MAP_RENAME = 0x20
- NET_RT_MAXID = 0x6
- RTF_PRCLONING = 0x10000
- RTM_OLDADD = 0x9
- RTM_OLDDEL = 0xa
- SIOCADDRT = 0x8030720a
- SIOCALIFADDR = 0x8118691b
- SIOCDELRT = 0x8030720b
- SIOCDLIFADDR = 0x8118691d
- SIOCGLIFADDR = 0xc118691c
- SIOCGLIFPHYADDR = 0xc118694b
- SIOCSLIFPHYADDR = 0x8118694a
-)
diff --git a/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go
deleted file mode 100644
index 946dcf3..0000000
--- a/vendor/golang.org/x/sys/unix/errors_freebsd_arm64.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2020 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.
-
-// Constants that were deprecated or moved to enums in the FreeBSD headers. Keep
-// them here for backwards compatibility.
-
-package unix
-
-const (
- DLT_HHDLC = 0x79
- IPV6_MIN_MEMBERSHIPS = 0x1f
- IP_MAX_SOURCE_FILTER = 0x400
- IP_MIN_MEMBERSHIPS = 0x1f
- RT_CACHING_CONTEXT = 0x1
- RT_NORTREF = 0x2
-)
diff --git a/vendor/golang.org/x/sys/unix/gccgo.go b/vendor/golang.org/x/sys/unix/gccgo.go
index 0dee232..b06f52d 100644
--- a/vendor/golang.org/x/sys/unix/gccgo.go
+++ b/vendor/golang.org/x/sys/unix/gccgo.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build gccgo && !aix
-// +build gccgo,!aix
+//go:build gccgo && !aix && !hurd
+// +build gccgo,!aix,!hurd
package unix
diff --git a/vendor/golang.org/x/sys/unix/gccgo_c.c b/vendor/golang.org/x/sys/unix/gccgo_c.c
index 2cb1fef..c4fce0e 100644
--- a/vendor/golang.org/x/sys/unix/gccgo_c.c
+++ b/vendor/golang.org/x/sys/unix/gccgo_c.c
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// +build gccgo
-// +build !aix
+// +build gccgo,!hurd
+// +build !aix,!hurd
#include
#include
diff --git a/vendor/golang.org/x/sys/unix/ifreq_linux.go b/vendor/golang.org/x/sys/unix/ifreq_linux.go
index 934af31..15721a5 100644
--- a/vendor/golang.org/x/sys/unix/ifreq_linux.go
+++ b/vendor/golang.org/x/sys/unix/ifreq_linux.go
@@ -8,7 +8,6 @@
package unix
import (
- "bytes"
"unsafe"
)
@@ -45,13 +44,7 @@ func NewIfreq(name string) (*Ifreq, error) {
// Name returns the interface name associated with the Ifreq.
func (ifr *Ifreq) Name() string {
- // BytePtrToString requires a NULL terminator or the program may crash. If
- // one is not present, just return the empty string.
- if !bytes.Contains(ifr.raw.Ifrn[:], []byte{0x00}) {
- return ""
- }
-
- return BytePtrToString(&ifr.raw.Ifrn[0])
+ return ByteSliceToString(ifr.raw.Ifrn[:])
}
// According to netdevice(7), only AF_INET addresses are returned for numerous
diff --git a/vendor/golang.org/x/sys/unix/ioctl.go b/vendor/golang.org/x/sys/unix/ioctl.go
index 6c7ad05..1c51b0e 100644
--- a/vendor/golang.org/x/sys/unix/ioctl.go
+++ b/vendor/golang.org/x/sys/unix/ioctl.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build aix || darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd || solaris
+// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris
package unix
diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go
index 1dadead..0d12c08 100644
--- a/vendor/golang.org/x/sys/unix/ioctl_linux.go
+++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go
@@ -4,9 +4,7 @@
package unix
-import (
- "unsafe"
-)
+import "unsafe"
// IoctlRetInt performs an ioctl operation specified by req on a device
// associated with opened file descriptor fd, and returns a non-negative
@@ -194,3 +192,42 @@ func ioctlIfreqData(fd int, req uint, value *ifreqData) error {
// identical so pass *IfreqData directly.
return ioctlPtr(fd, req, unsafe.Pointer(value))
}
+
+// IoctlKCMClone attaches a new file descriptor to a multiplexor by cloning an
+// existing KCM socket, returning a structure containing the file descriptor of
+// the new socket.
+func IoctlKCMClone(fd int) (*KCMClone, error) {
+ var info KCMClone
+ if err := ioctlPtr(fd, SIOCKCMCLONE, unsafe.Pointer(&info)); err != nil {
+ return nil, err
+ }
+
+ return &info, nil
+}
+
+// IoctlKCMAttach attaches a TCP socket and associated BPF program file
+// descriptor to a multiplexor.
+func IoctlKCMAttach(fd int, info KCMAttach) error {
+ return ioctlPtr(fd, SIOCKCMATTACH, unsafe.Pointer(&info))
+}
+
+// IoctlKCMUnattach unattaches a TCP socket file descriptor from a multiplexor.
+func IoctlKCMUnattach(fd int, info KCMUnattach) error {
+ return ioctlPtr(fd, SIOCKCMUNATTACH, unsafe.Pointer(&info))
+}
+
+// IoctlLoopGetStatus64 gets the status of the loop device associated with the
+// file descriptor fd using the LOOP_GET_STATUS64 operation.
+func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) {
+ var value LoopInfo64
+ if err := ioctlPtr(fd, LOOP_GET_STATUS64, unsafe.Pointer(&value)); err != nil {
+ return nil, err
+ }
+ return &value, nil
+}
+
+// IoctlLoopSetStatus64 sets the status of the loop device associated with the
+// file descriptor fd using the LOOP_SET_STATUS64 operation.
+func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error {
+ return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value))
+}
diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh
old mode 100755
new mode 100644
index ee73623..8e3947c
--- a/vendor/golang.org/x/sys/unix/mkall.sh
+++ b/vendor/golang.org/x/sys/unix/mkall.sh
@@ -73,12 +73,12 @@ aix_ppc64)
darwin_amd64)
mkerrors="$mkerrors -m64"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
+ mkasm="go run mkasm.go"
;;
darwin_arm64)
mkerrors="$mkerrors -m64"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
- mkasm="go run mkasm_darwin.go"
+ mkasm="go run mkasm.go"
;;
dragonfly_amd64)
mkerrors="$mkerrors -m64"
@@ -89,25 +89,30 @@ dragonfly_amd64)
freebsd_386)
mkerrors="$mkerrors -m32"
mksyscall="go run mksyscall.go -l32"
- mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
+ mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
freebsd_amd64)
mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
+ mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
freebsd_arm)
mkerrors="$mkerrors"
mksyscall="go run mksyscall.go -l32 -arm"
- mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
+ mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
# Let the type of C char be signed for making the bare syscall
# API consistent across platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
freebsd_arm64)
mkerrors="$mkerrors -m64"
- mksysnum="go run mksysnum.go 'https://svn.freebsd.org/base/stable/11/sys/kern/syscalls.master'"
+ mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
+ mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
+ ;;
+freebsd_riscv64)
+ mkerrors="$mkerrors -m64"
+ mksysnum="go run mksysnum.go 'https://cgit.freebsd.org/src/plain/sys/kern/syscalls.master?h=stable/12'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
netbsd_386)
@@ -137,42 +142,60 @@ netbsd_arm64)
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
openbsd_386)
+ mkasm="go run mkasm.go"
mkerrors="$mkerrors -m32"
- mksyscall="go run mksyscall.go -l32 -openbsd"
+ mksyscall="go run mksyscall.go -l32 -openbsd -libc"
mksysctl="go run mksysctl_openbsd.go"
- mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
openbsd_amd64)
+ mkasm="go run mkasm.go"
mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -openbsd"
+ mksyscall="go run mksyscall.go -openbsd -libc"
mksysctl="go run mksysctl_openbsd.go"
- mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
mktypes="GOARCH=$GOARCH go tool cgo -godefs"
;;
openbsd_arm)
+ mkasm="go run mkasm.go"
mkerrors="$mkerrors"
- mksyscall="go run mksyscall.go -l32 -openbsd -arm"
+ mksyscall="go run mksyscall.go -l32 -openbsd -arm -libc"
mksysctl="go run mksysctl_openbsd.go"
- mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
# Let the type of C char be signed for making the bare syscall
# API consistent across platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
openbsd_arm64)
+ mkasm="go run mkasm.go"
mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -openbsd"
+ mksyscall="go run mksyscall.go -openbsd -libc"
mksysctl="go run mksysctl_openbsd.go"
- mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
# Let the type of C char be signed for making the bare syscall
# API consistent across platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
;;
openbsd_mips64)
+ mkasm="go run mkasm.go"
mkerrors="$mkerrors -m64"
- mksyscall="go run mksyscall.go -openbsd"
+ mksyscall="go run mksyscall.go -openbsd -libc"
+ mksysctl="go run mksysctl_openbsd.go"
+ # Let the type of C char be signed for making the bare syscall
+ # API consistent across platforms.
+ mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
+ ;;
+openbsd_ppc64)
+ mkasm="go run mkasm.go"
+ mkerrors="$mkerrors -m64"
+ mksyscall="go run mksyscall.go -openbsd -libc"
+ mksysctl="go run mksysctl_openbsd.go"
+ # Let the type of C char be signed for making the bare syscall
+ # API consistent across platforms.
+ mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
+ ;;
+openbsd_riscv64)
+ mkasm="go run mkasm.go"
+ mkerrors="$mkerrors -m64"
+ mksyscall="go run mksyscall.go -openbsd -libc"
mksysctl="go run mksysctl_openbsd.go"
- mksysnum="go run mksysnum.go 'https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master'"
# Let the type of C char be signed for making the bare syscall
# API consistent across platforms.
mktypes="GOARCH=$GOARCH go tool cgo -godefs -- -fsigned-char"
@@ -209,11 +232,6 @@ esac
if [ "$GOOSARCH" == "aix_ppc64" ]; then
# aix/ppc64 script generates files instead of writing to stdin.
echo "$mksyscall -tags $GOOS,$GOARCH $syscall_goos $GOOSARCH_in && gofmt -w zsyscall_$GOOSARCH.go && gofmt -w zsyscall_"$GOOSARCH"_gccgo.go && gofmt -w zsyscall_"$GOOSARCH"_gc.go " ;
- elif [ "$GOOS" == "darwin" ]; then
- # 1.12 and later, syscalls via libSystem
- echo "$mksyscall -tags $GOOS,$GOARCH,go1.12 $syscall_goos $GOOSARCH_in |gofmt >zsyscall_$GOOSARCH.go";
- # 1.13 and later, syscalls via libSystem (including syscallPtr)
- echo "$mksyscall -tags $GOOS,$GOARCH,go1.13 syscall_darwin.1_13.go |gofmt >zsyscall_$GOOSARCH.1_13.go";
elif [ "$GOOS" == "illumos" ]; then
# illumos code generation requires a --illumos switch
echo "$mksyscall -illumos -tags illumos,$GOARCH syscall_illumos.go |gofmt > zsyscall_illumos_$GOARCH.go";
@@ -227,5 +245,5 @@ esac
if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
if [ -n "$mksysnum" ]; then echo "$mksysnum |gofmt >zsysnum_$GOOSARCH.go"; fi
if [ -n "$mktypes" ]; then echo "$mktypes types_$GOOS.go | go run mkpost.go > ztypes_$GOOSARCH.go"; fi
- if [ -n "$mkasm" ]; then echo "$mkasm $GOARCH"; fi
+ if [ -n "$mkasm" ]; then echo "$mkasm $GOOS $GOARCH"; fi
) | $run
diff --git a/vendor/golang.org/x/sys/unix/mkasm_darwin.go b/vendor/golang.org/x/sys/unix/mkasm_darwin.go
deleted file mode 100644
index 49b1c94..0000000
--- a/vendor/golang.org/x/sys/unix/mkasm_darwin.go
+++ /dev/null
@@ -1,136 +0,0 @@
-// 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.
-
-//go:build ignore
-// +build ignore
-
-// mkasm_darwin.go generates assembly trampolines to call libSystem routines from Go.
-//This program must be run after mksyscall.go.
-package main
-
-import (
- "bytes"
- "fmt"
- "io/ioutil"
- "log"
- "os"
- "sort"
- "strings"
-)
-
-const ptrsize = 8 // Pointer size. All supported platforms are 64-bit.
-
-func writeASMFile(in string, fileName string, buildTags string) map[string]bool {
- trampolines := map[string]bool{}
-
- var out bytes.Buffer
-
- fmt.Fprintf(&out, "// go run mkasm_darwin.go %s\n", strings.Join(os.Args[1:], " "))
- fmt.Fprintf(&out, "// Code generated by the command above; DO NOT EDIT.\n")
- fmt.Fprintf(&out, "\n")
- fmt.Fprintf(&out, "//go:build %s\n", buildTags)
- fmt.Fprintf(&out, "// +build %s\n", buildTags)
- fmt.Fprintf(&out, "\n")
- fmt.Fprintf(&out, "#include \"textflag.h\"\n")
- for _, line := range strings.Split(in, "\n") {
- const prefix = "var "
- const suffix = "_trampoline_addr uintptr"
- if !strings.HasPrefix(line, prefix) || !strings.HasSuffix(line, suffix) {
- continue
- }
- fn := strings.TrimSuffix(strings.TrimPrefix(line, prefix), suffix)
- if !trampolines[fn] {
- trampolines[fn] = true
- fmt.Fprintf(&out, "\nTEXT %s_trampoline<>(SB),NOSPLIT,$0-0\n", fn)
- fmt.Fprintf(&out, "\tJMP\t%s(SB)\n\n", fn)
- fmt.Fprintf(&out, "GLOBL\t·%s_trampoline_addr(SB), RODATA, $%d\n", fn, ptrsize)
- fmt.Fprintf(&out, "DATA\t·%s_trampoline_addr(SB)/%d, $%s_trampoline<>(SB)\n", fn, ptrsize, fn)
- }
- }
- err := ioutil.WriteFile(fileName, out.Bytes(), 0644)
- if err != nil {
- log.Fatalf("can't write %s: %s", fileName, err)
- }
-
- return trampolines
-}
-
-const darwinTestTemplate = `// go run mkasm_darwin.go %s
-// Code generated by the command above; DO NOT EDIT.
-
-//go:build darwin && go1.12
-// +build darwin,go1.12
-
-package unix
-
-// All the _trampoline functions in zsyscall_darwin_%s.s.
-var darwinTests = [...]darwinTest{
-%s}
-`
-
-func writeDarwinTest(trampolines map[string]bool, fileName, arch string) {
- // sort trampolines
- sorted := make([]string, len(trampolines))
- i := 0
- for trampoline := range trampolines {
- sorted[i] = trampoline
- i++
- }
- sort.Slice(sorted, func(i, j int) bool { return sorted[i] < sorted[j] })
-
- var out bytes.Buffer
-
- const prefix = "libc_"
- for _, trampoline := range sorted {
- fmt.Fprintf(&out, fmt.Sprintf("\t{%q, %s_trampoline_addr},\n", strings.TrimPrefix(trampoline, prefix), trampoline))
- }
- lines := out.String()
-
- out.Reset()
- fmt.Fprintf(&out, darwinTestTemplate, strings.Join(os.Args[1:], " "), arch, lines)
-
- err := ioutil.WriteFile(fileName, out.Bytes(), 0644)
- if err != nil {
- log.Fatalf("can't write %s: %s", fileName, err)
- }
-}
-
-func main() {
- in1, err := ioutil.ReadFile("syscall_darwin.go")
- if err != nil {
- log.Fatalf("can't open syscall_darwin.go: %s", err)
- }
- arch := os.Args[1]
- in2, err := ioutil.ReadFile(fmt.Sprintf("syscall_darwin_%s.go", arch))
- if err != nil {
- log.Fatalf("can't open syscall_darwin_%s.go: %s", arch, err)
- }
- in3, err := ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.go", arch))
- if err != nil {
- log.Fatalf("can't open zsyscall_darwin_%s.go: %s", arch, err)
- }
- in := string(in1) + string(in2) + string(in3)
-
- trampolines := writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.s", arch), "go1.12")
-
- in1, err = ioutil.ReadFile("syscall_darwin.1_13.go")
- if err != nil {
- log.Fatalf("can't open syscall_darwin.1_13.go: %s", err)
- }
- in2, err = ioutil.ReadFile(fmt.Sprintf("zsyscall_darwin_%s.1_13.go", arch))
- if err != nil {
- log.Fatalf("can't open zsyscall_darwin_%s.1_13.go: %s", arch, err)
- }
-
- in = string(in1) + string(in2)
-
- trampolines2 := writeASMFile(in, fmt.Sprintf("zsyscall_darwin_%s.1_13.s", arch), "go1.13")
-
- // merge trampolines
- for trampoline := range trampolines2 {
- trampolines[trampoline] = true
- }
-
- writeDarwinTest(trampolines, fmt.Sprintf("darwin_%s_test.go", arch), arch)
-}
diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh
old mode 100755
new mode 100644
index a47b035..7456d9d
--- a/vendor/golang.org/x/sys/unix/mkerrors.sh
+++ b/vendor/golang.org/x/sys/unix/mkerrors.sh
@@ -128,6 +128,7 @@ includes_FreeBSD='
#include
#include
#include
+#include
#include
#include
#include
@@ -202,9 +203,11 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
+#include
#include
#include
#include
@@ -214,6 +217,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -231,6 +235,7 @@ struct ltchars {
#include
#include
#include
+#include
#include
#include
#include
@@ -292,6 +297,10 @@ struct ltchars {
#define SOL_NETLINK 270
#endif
+#ifndef SOL_SMC
+#define SOL_SMC 286
+#endif
+
#ifdef SOL_BLUETOOTH
// SPARC includes this in /usr/include/sparc64-linux-gnu/bits/socket.h
// but it is already in bluetooth_linux.go
@@ -503,6 +512,7 @@ ccflags="$@"
$2 ~ /^O?XTABS$/ ||
$2 ~ /^TC[IO](ON|OFF)$/ ||
$2 ~ /^IN_/ ||
+ $2 ~ /^KCM/ ||
$2 ~ /^LANDLOCK_/ ||
$2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
$2 ~ /^LO_(KEY|NAME)_SIZE$/ ||
@@ -525,7 +535,7 @@ ccflags="$@"
$2 ~ /^(MS|MNT|MOUNT|UMOUNT)_/ ||
$2 ~ /^NS_GET_/ ||
$2 ~ /^TUN(SET|GET|ATTACH|DETACH)/ ||
- $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|TFD)_/ ||
+ $2 ~ /^(O|F|[ES]?FD|NAME|S|PTRACE|PT|PIOD|TFD)_/ ||
$2 ~ /^KEXEC_/ ||
$2 ~ /^LINUX_REBOOT_CMD_/ ||
$2 ~ /^LINUX_REBOOT_MAGIC[12]$/ ||
@@ -549,6 +559,7 @@ ccflags="$@"
$2 ~ /^CLONE_[A-Z_]+/ ||
$2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ &&
$2 ~ /^(BPF|DLT)_/ ||
+ $2 ~ /^AUDIT_/ ||
$2 ~ /^(CLOCK|TIMER)_/ ||
$2 ~ /^CAN_/ ||
$2 ~ /^CAP_/ ||
@@ -571,7 +582,6 @@ ccflags="$@"
$2 ~ /^SEEK_/ ||
$2 ~ /^SPLICE_/ ||
$2 ~ /^SYNC_FILE_RANGE_/ ||
- $2 !~ /^AUDIT_RECORD_MAGIC/ &&
$2 !~ /IOC_MAGIC/ &&
$2 ~ /^[A-Z][A-Z0-9_]+_MAGIC2?$/ ||
$2 ~ /^(VM|VMADDR)_/ ||
@@ -597,8 +607,10 @@ ccflags="$@"
$2 ~ /^DEVLINK_/ ||
$2 ~ /^ETHTOOL_/ ||
$2 ~ /^LWTUNNEL_IP/ ||
+ $2 ~ /^ITIMER_/ ||
$2 !~ "WMESGLEN" &&
$2 ~ /^W[A-Z0-9]+$/ ||
+ $2 ~ /^P_/ ||
$2 ~/^PPPIOC/ ||
$2 ~ /^FAN_|FANOTIFY_/ ||
$2 == "HID_MAX_DESCRIPTOR_SIZE" ||
@@ -608,6 +620,7 @@ ccflags="$@"
$2 ~ /^OTP/ ||
$2 ~ /^MEM/ ||
$2 ~ /^WG/ ||
+ $2 ~ /^FIB_RULE_/ ||
$2 ~ /^BLK[A-Z]*(GET$|SET$|BUF$|PART$|SIZE)/ {printf("\t%s = C.%s\n", $2, $2)}
$2 ~ /^__WCOREFLAG$/ {next}
$2 ~ /^__W[A-Z0-9]+$/ {printf("\t%s = C.%s\n", substr($2,3), $2)}
@@ -629,7 +642,7 @@ errors=$(
signals=$(
echo '#include ' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
- egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
+ grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
sort
)
@@ -639,7 +652,7 @@ echo '#include ' | $CC -x c - -E -dM $ccflags |
sort >_error.grep
echo '#include ' | $CC -x c - -E -dM $ccflags |
awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
- egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT|SIGMAX64)' |
+ grep -v 'SIGSTKSIZE\|SIGSTKSZ\|SIGRT\|SIGMAX64' |
sort >_signal.grep
echo '// mkerrors.sh' "$@"
diff --git a/vendor/golang.org/x/sys/unix/mkpost.go b/vendor/golang.org/x/sys/unix/mkpost.go
deleted file mode 100644
index a275518..0000000
--- a/vendor/golang.org/x/sys/unix/mkpost.go
+++ /dev/null
@@ -1,180 +0,0 @@
-// Copyright 2016 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.
-
-//go:build ignore
-// +build ignore
-
-// mkpost processes the output of cgo -godefs to
-// modify the generated types. It is used to clean up
-// the sys API in an architecture specific manner.
-//
-// mkpost is run after cgo -godefs; see README.md.
-package main
-
-import (
- "bytes"
- "fmt"
- "go/format"
- "io/ioutil"
- "log"
- "os"
- "regexp"
-)
-
-func main() {
- // Get the OS and architecture (using GOARCH_TARGET if it exists)
- goos := os.Getenv("GOOS")
- goarch := os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check that we are using the Docker-based build system if we should be.
- if goos == "linux" {
- if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- os.Stderr.WriteString("In the Docker-based build system, mkpost should not be called directly.\n")
- os.Stderr.WriteString("See README.md\n")
- os.Exit(1)
- }
- }
-
- b, err := ioutil.ReadAll(os.Stdin)
- if err != nil {
- log.Fatal(err)
- }
-
- if goos == "aix" {
- // Replace type of Atim, Mtim and Ctim by Timespec in Stat_t
- // to avoid having both StTimespec and Timespec.
- sttimespec := regexp.MustCompile(`_Ctype_struct_st_timespec`)
- b = sttimespec.ReplaceAll(b, []byte("Timespec"))
- }
-
- if goos == "darwin" {
- // KinfoProc contains various pointers to objects stored
- // in kernel space. Replace these by uintptr to prevent
- // accidental dereferencing.
- kinfoProcPointerRegex := regexp.MustCompile(`\*_Ctype_struct_(pgrp|proc|session|sigacts|ucred|user|vnode)`)
- b = kinfoProcPointerRegex.ReplaceAll(b, []byte("uintptr"))
-
- // ExternProc contains a p_un member that in kernel
- // space stores a pair of pointers and in user space
- // stores the process creation time. We only care about
- // the process creation time.
- externProcStarttimeRegex := regexp.MustCompile(`P_un\s*\[\d+\]byte`)
- b = externProcStarttimeRegex.ReplaceAll(b, []byte("P_starttime Timeval"))
-
- // Convert [n]int8 to [n]byte in Eproc and ExternProc members to
- // simplify conversion to string.
- convertEprocRegex := regexp.MustCompile(`(P_comm|Wmesg|Login)(\s+)\[(\d+)\]int8`)
- b = convertEprocRegex.ReplaceAll(b, []byte("$1$2[$3]byte"))
- }
-
- // Intentionally export __val fields in Fsid and Sigset_t
- valRegex := regexp.MustCompile(`type (Fsid|Sigset_t) struct {(\s+)X__(bits|val)(\s+\S+\s+)}`)
- b = valRegex.ReplaceAll(b, []byte("type $1 struct {${2}Val$4}"))
-
- // Intentionally export __fds_bits field in FdSet
- fdSetRegex := regexp.MustCompile(`type (FdSet) struct {(\s+)X__fds_bits(\s+\S+\s+)}`)
- b = fdSetRegex.ReplaceAll(b, []byte("type $1 struct {${2}Bits$3}"))
-
- // Intentionally export __icmp6_filt field in icmpv6_filter
- icmpV6Regex := regexp.MustCompile(`type (ICMPv6Filter) struct {(\s+)X__icmp6_filt(\s+\S+\s+)}`)
- b = icmpV6Regex.ReplaceAll(b, []byte("type $1 struct {${2}Filt$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*})`)
- b = ptraceRexexp.ReplaceAll(b, nil)
-
- // Replace the control_regs union with a blank identifier for now.
- controlRegsRegex := regexp.MustCompile(`(Control_regs)\s+\[0\]uint64`)
- b = controlRegsRegex.ReplaceAll(b, []byte("_ [0]uint64"))
-
- // Remove fields that are added by glibc
- // Note that this is unstable as the identifers are private.
- removeFieldsRegex := regexp.MustCompile(`X__glibc\S*`)
- b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Convert [65]int8 to [65]byte in Utsname members to simplify
- // conversion to string; see golang.org/issue/20753
- convertUtsnameRegex := regexp.MustCompile(`((Sys|Node|Domain)name|Release|Version|Machine)(\s+)\[(\d+)\]u?int8`)
- b = convertUtsnameRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
-
- // Convert [n]int8 to [n]byte in Statvfs_t members to simplify
- // conversion to string.
- convertStatvfsRegex := regexp.MustCompile(`((Fstype|Mnton|Mntfrom)name)(\s+)\[(\d+)\]int8`)
- b = convertStatvfsRegex.ReplaceAll(b, []byte("$1$3[$4]byte"))
-
- // Convert []int8 to []byte in device mapper ioctl interface
- convertDmIoctlNames := regexp.MustCompile(`(Name|Uuid|Target_type|Data)(\s+)\[(\d+)\]u?int8`)
- dmIoctlTypes := regexp.MustCompile(`type Dm(\S+) struct {[^}]*}`)
- dmStructs := dmIoctlTypes.FindAll(b, -1)
- for _, s := range dmStructs {
- newNames := convertDmIoctlNames.ReplaceAll(s, []byte("$1$2[$3]byte"))
- b = bytes.Replace(b, s, newNames, 1)
- }
-
- // Convert []int8 to []byte in EthtoolDrvinfo
- convertEthtoolDrvinfoNames := regexp.MustCompile(`(Driver|Version|Fw_version|Bus_info|Erom_version|Reserved2)(\s+)\[(\d+)\]u?int8`)
- ethtoolDrvinfoTypes := regexp.MustCompile(`type EthtoolDrvinfo struct {[^}]*}`)
- ethtoolDrvinfoStructs := ethtoolDrvinfoTypes.FindAll(b, -1)
- for _, s := range ethtoolDrvinfoStructs {
- newNames := convertEthtoolDrvinfoNames.ReplaceAll(s, []byte("$1$2[$3]byte"))
- b = bytes.Replace(b, s, newNames, 1)
- }
-
- // Convert []int8 to []byte in ctl_info ioctl interface
- convertCtlInfoName := regexp.MustCompile(`(Name)(\s+)\[(\d+)\]int8`)
- ctlInfoType := regexp.MustCompile(`type CtlInfo struct {[^}]*}`)
- ctlInfoStructs := ctlInfoType.FindAll(b, -1)
- for _, s := range ctlInfoStructs {
- newNames := convertCtlInfoName.ReplaceAll(s, []byte("$1$2[$3]byte"))
- b = bytes.Replace(b, s, newNames, 1)
- }
-
- // Convert [1024]int8 to [1024]byte in Ptmget members
- convertPtmget := regexp.MustCompile(`([SC]n)(\s+)\[(\d+)\]u?int8`)
- b = convertPtmget.ReplaceAll(b, []byte("$1[$3]byte"))
-
- // Remove spare fields (e.g. in Statx_t)
- spareFieldsRegex := regexp.MustCompile(`X__spare\S*`)
- b = spareFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove cgo padding fields
- removePaddingFieldsRegex := regexp.MustCompile(`Pad_cgo_\d+`)
- b = removePaddingFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove padding, hidden, or unused fields
- removeFieldsRegex = regexp.MustCompile(`\b(X_\S+|Padding)`)
- b = removeFieldsRegex.ReplaceAll(b, []byte("_"))
-
- // Remove the first line of warning from cgo
- b = b[bytes.IndexByte(b, '\n')+1:]
- // Modify the command in the header to include:
- // mkpost, our own warning, and a build tag.
- replacement := fmt.Sprintf(`$1 | go run mkpost.go
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s && %s
-// +build %s,%s`, goarch, goos, goarch, goos)
- cgoCommandRegex := regexp.MustCompile(`(cgo -godefs .*)`)
- b = cgoCommandRegex.ReplaceAll(b, []byte(replacement))
-
- // Rename Stat_t time fields
- if goos == "freebsd" && goarch == "386" {
- // Hide Stat_t.[AMCB]tim_ext fields
- renameStatTimeExtFieldsRegex := regexp.MustCompile(`[AMCB]tim_ext`)
- b = renameStatTimeExtFieldsRegex.ReplaceAll(b, []byte("_"))
- }
- renameStatTimeFieldsRegex := regexp.MustCompile(`([AMCB])(?:irth)?time?(?:spec)?\s+(Timespec|StTimespec)`)
- b = renameStatTimeFieldsRegex.ReplaceAll(b, []byte("${1}tim ${2}"))
-
- // gofmt
- b, err = format.Source(b)
- if err != nil {
- log.Fatal(err)
- }
-
- os.Stdout.Write(b)
-}
diff --git a/vendor/golang.org/x/sys/unix/mksyscall.go b/vendor/golang.org/x/sys/unix/mksyscall.go
deleted file mode 100644
index 9df3c87..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall.go
+++ /dev/null
@@ -1,399 +0,0 @@
-// 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_darwin.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named errno.
-
-A line beginning with //sysnb is like //sys, except that the
-goroutine will not be suspended during the execution of the system
-call. This must only be used for system calls which can never
-block, as otherwise the system call could cause all goroutines to
-hang.
-*/
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- plan9 = flag.Bool("plan9", false, "plan9")
- openbsd = flag.Bool("openbsd", false, "openbsd")
- netbsd = flag.Bool("netbsd", false, "netbsd")
- dragonfly = flag.Bool("dragonfly", false, "dragonfly")
- arm = flag.Bool("arm", false, "arm") // 64-bit value should use (even, odd)-pair
- tags = flag.String("tags", "", "build tags")
- filename = flag.String("output", "", "output file name (standard output if omitted)")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return strings.ReplaceAll(*tags, ",", " && ")
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- goos := os.Getenv("GOOS_TARGET")
- if goos == "" {
- goos = os.Getenv("GOOS")
- }
- if goos == "" {
- fmt.Fprintln(os.Stderr, "GOOS not defined in environment")
- os.Exit(1)
- }
-
- // Check that we are using the Docker-based build system if we should
- if goos == "linux" {
- if os.Getenv("GOLANG_SYS_BUILD") != "docker" {
- fmt.Fprintf(os.Stderr, "In the Docker-based build system, mksyscall should not be called directly.\n")
- fmt.Fprintf(os.Stderr, "See README.md\n")
- os.Exit(1)
- }
- }
-
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- libc := false
- if goos == "darwin" {
- libc = true
- }
- trampolines := map[string]bool{}
-
- text := ""
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, errno error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*((?i)SYS_[A-Z0-9_]+))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, sysname := f[2], f[3], f[4], f[5]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // Go function header.
- outDecl := ""
- if len(out) > 0 {
- outDecl = fmt.Sprintf(" (%s)", strings.Join(out, ", "))
- }
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outDecl)
-
- // Check if err return available
- errvar := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- break
- }
- }
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, %s = BytePtrFromString(%s)\n", n, errvar, p.Name)
- text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\tvar _p%d *byte\n", n)
- text += fmt.Sprintf("\t_p%d, _ = BytePtrFromString(%s)\n", n, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass dummy pointer in that case.
- // Used to pass nil, but some OSes or simulators reject write(fd, nil, 0).
- text += fmt.Sprintf("\tvar _p%d unsafe.Pointer\n", n)
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = unsafe.Pointer(&%s[0])\n\t}", p.Name, n, p.Name)
- text += fmt.Sprintf(" else {\n\t\t_p%d = unsafe.Pointer(&_zero)\n\t}\n", n)
- args = append(args, fmt.Sprintf("uintptr(_p%d)", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
- n++
- } else if p.Type == "int64" && (*openbsd || *netbsd) {
- args = append(args, "0")
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if p.Type == "int64" && *dragonfly {
- if regexp.MustCompile(`^(?i)extp(read|write)`).FindStringSubmatch(funct) == nil {
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else if endianness == "little-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- } else if (p.Type == "int64" || p.Type == "uint64") && endianness != "" {
- if len(args)%2 == 1 && *arm {
- // arm abi specifies 64-bit argument uses
- // (even, odd) pair
- args = append(args, "0")
- }
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- }
-
- // Determine which form to use; pad args with zeros.
- asm := "Syscall"
- if nonblock != nil {
- if errvar == "" && goos == "linux" {
- asm = "RawSyscallNoError"
- } else {
- asm = "RawSyscall"
- }
- } else {
- if errvar == "" && goos == "linux" {
- asm = "SyscallNoError"
- }
- }
- if len(args) <= 3 {
- for len(args) < 3 {
- args = append(args, "0")
- }
- } else if len(args) <= 6 {
- asm += "6"
- for len(args) < 6 {
- args = append(args, "0")
- }
- } else if len(args) <= 9 {
- asm += "9"
- for len(args) < 9 {
- args = append(args, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s:%s too many arguments to system call\n", path, funct)
- }
-
- // System call number.
- if sysname == "" {
- sysname = "SYS_" + funct
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToUpper(sysname)
- }
-
- var libcFn string
- if libc {
- asm = "syscall_" + strings.ToLower(asm[:1]) + asm[1:] // internal syscall call
- sysname = strings.TrimPrefix(sysname, "SYS_") // remove SYS_
- sysname = strings.ToLower(sysname) // lowercase
- libcFn = sysname
- sysname = "libc_" + sysname + "_trampoline_addr"
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := fmt.Sprintf("%s(%s, %s)", asm, sysname, arglist)
-
- // Assign return values.
- body := ""
- ret := []string{"_", "_", "_"}
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" && !*plan9 {
- reg = "e1"
- ret[2] = reg
- doErrno = true
- } else if p.Name == "err" && *plan9 {
- ret[0] = "r0"
- ret[2] = "e1"
- break
- } else {
- reg = fmt.Sprintf("r%d", i)
- ret[i] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%s != 0", reg)
- }
- if p.Type == "int64" && endianness != "" {
- // 64-bit number in r1:r0 or r0:r1.
- if i+2 > len(out) {
- fmt.Fprintf(os.Stderr, "%s:%s not enough registers for int64 return\n", path, funct)
- }
- if endianness == "big-endian" {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
- } else {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
- }
- ret[i] = fmt.Sprintf("r%d", i)
- ret[i+1] = fmt.Sprintf("r%d", i+1)
- }
- if reg != "e1" || *plan9 {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
- text += fmt.Sprintf("\t%s\n", call)
- } else {
- if errvar == "" && goos == "linux" {
- // raw syscall without error on Linux, see golang.org/issue/22924
- text += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], call)
- } else {
- text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
- }
- }
- text += body
-
- if *plan9 && ret[2] == "e1" {
- text += "\tif int32(r0) == -1 {\n"
- text += "\t\terr = e1\n"
- text += "\t}\n"
- } else if doErrno {
- text += "\tif e1 != 0 {\n"
- text += "\t\terr = errnoErr(e1)\n"
- text += "\t}\n"
- }
- text += "\treturn\n"
- text += "}\n\n"
-
- if libc && !trampolines[libcFn] {
- // some system calls share a trampoline, like read and readlen.
- trampolines[libcFn] = true
- // Declare assembly trampoline address.
- text += fmt.Sprintf("var libc_%s_trampoline_addr uintptr\n\n", libcFn)
- // Assembly trampoline calls the libc_* function, which this magic
- // redirects to use the function from libSystem.
- text += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"/usr/lib/libSystem.B.dylib\"\n", libcFn, libcFn)
- text += "\n"
- }
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- fmt.Printf(srcTemplate, cmdLine(), goBuildTags(), plusBuildTags(), text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package unix
-
-import (
- "syscall"
- "unsafe"
-)
-
-var _ syscall.Errno
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go
deleted file mode 100644
index 0143137..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc.go
+++ /dev/null
@@ -1,420 +0,0 @@
-// Copyright 2019 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_aix.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-*/
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- aix = flag.Bool("aix", false, "aix")
- tags = flag.String("tags", "", "build tags")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_aix_ppc.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return strings.ReplaceAll(*tags, ",", " && ")
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- text := ""
- cExtern := "/*\n#include \n#include \n"
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // Check if value return, err return available
- errvar := ""
- retvar := ""
- rettype := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- } else {
- retvar = p.Name
- rettype = p.Type
- }
- }
-
- // System call name.
- if sysname == "" {
- sysname = funct
- }
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- cRettype := ""
- if rettype == "unsafe.Pointer" {
- cRettype = "uintptr_t"
- } else if rettype == "uintptr" {
- cRettype = "uintptr_t"
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil {
- cRettype = "uintptr_t"
- } else if rettype == "int" {
- cRettype = "int"
- } else if rettype == "int32" {
- cRettype = "int"
- } else if rettype == "int64" {
- cRettype = "long long"
- } else if rettype == "uint32" {
- cRettype = "unsigned int"
- } else if rettype == "uint64" {
- cRettype = "unsigned long long"
- } else {
- cRettype = "int"
- }
- if sysname == "exit" {
- cRettype = "void"
- }
-
- // Change p.Types to c
- var cIn []string
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "string" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t", "size_t")
- } else if p.Type == "unsafe.Pointer" {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "uintptr" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "int" {
- cIn = append(cIn, "int")
- } else if p.Type == "int32" {
- cIn = append(cIn, "int")
- } else if p.Type == "int64" {
- cIn = append(cIn, "long long")
- } else if p.Type == "uint32" {
- cIn = append(cIn, "unsigned int")
- } else if p.Type == "uint64" {
- cIn = append(cIn, "unsigned long long")
- } else {
- cIn = append(cIn, "int")
- }
- }
-
- if funct != "fcntl" && funct != "FcntlInt" && funct != "readlen" && funct != "writelen" {
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- cExtern += "#define c_select select\n"
- }
- // Imports of system calls from libc
- cExtern += fmt.Sprintf("%s %s", cRettype, sysname)
- cIn := strings.Join(cIn, ", ")
- cExtern += fmt.Sprintf("(%s);\n", cIn)
- }
-
- // So file name.
- if *aix {
- if modname == "" {
- modname = "libc.a/shr_64.o"
- } else {
- fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct)
- os.Exit(1)
- }
- }
-
- strconvfunc := "C.CString"
-
- // Go function header.
- if outps != "" {
- outps = fmt.Sprintf(" (%s)", outps)
- }
- if text != "" {
- text += "\n"
- }
-
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps)
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- argN := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "C.uintptr_t(uintptr(unsafe.Pointer("+p.Name+")))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\t_p%d := uintptr(unsafe.Pointer(%s(%s)))\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- text += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1])
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(unsafe.Pointer(_p%d)))", n))
- n++
- text += fmt.Sprintf("\tvar _p%d int\n", n)
- text += fmt.Sprintf("\t_p%d = len(%s)\n", n, p.Name)
- args = append(args, fmt.Sprintf("C.size_t(_p%d)", n))
- n++
- } else if p.Type == "int64" && endianness != "" {
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- n++
- } else if p.Type == "bool" {
- text += fmt.Sprintf("\tvar _p%d uint32\n", n)
- text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
- args = append(args, fmt.Sprintf("_p%d", n))
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
- } else if p.Type == "unsafe.Pointer" {
- args = append(args, fmt.Sprintf("C.uintptr_t(uintptr(%s))", p.Name))
- } else if p.Type == "int" {
- if (argN == 2) && ((funct == "readlen") || (funct == "writelen")) {
- args = append(args, fmt.Sprintf("C.size_t(%s)", p.Name))
- } else if argN == 0 && funct == "fcntl" {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if (argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt")) {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- }
- } else if p.Type == "int32" {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- } else if p.Type == "int64" {
- args = append(args, fmt.Sprintf("C.longlong(%s)", p.Name))
- } else if p.Type == "uint32" {
- args = append(args, fmt.Sprintf("C.uint(%s)", p.Name))
- } else if p.Type == "uint64" {
- args = append(args, fmt.Sprintf("C.ulonglong(%s)", p.Name))
- } else if p.Type == "uintptr" {
- args = append(args, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("C.int(%s)", p.Name))
- }
- argN++
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := ""
- if sysname == "exit" {
- if errvar != "" {
- call += "er :="
- } else {
- call += ""
- }
- } else if errvar != "" {
- call += "r0,er :="
- } else if retvar != "" {
- call += "r0,_ :="
- } else {
- call += ""
- }
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- call += fmt.Sprintf("C.c_%s(%s)", sysname, arglist)
- } else {
- call += fmt.Sprintf("C.%s(%s)", sysname, arglist)
- }
-
- // Assign return values.
- body := ""
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- } else {
- reg = "r0"
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
-
- // verify return
- if sysname != "exit" && errvar != "" {
- if regexp.MustCompile(`^uintptr`).FindStringSubmatch(cRettype) != nil {
- body += "\tif (uintptr(r0) ==^uintptr(0) && er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- } else {
- body += "\tif (r0 ==-1 && er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- }
- } else if errvar != "" {
- body += "\tif (er != nil) {\n"
- body += fmt.Sprintf("\t\t%s = er\n", errvar)
- body += "\t}\n"
- }
-
- text += fmt.Sprintf("\t%s\n", call)
- text += body
-
- text += "\treturn\n"
- text += "}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
-
- }
- fmt.Printf(srcTemplate, cmdLine(), goBuildTags(), plusBuildTags(), pack, cExtern, imp, text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package %s
-
-
-%s
-*/
-import "C"
-import (
- "unsafe"
-)
-
-
-%s
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go b/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go
deleted file mode 100644
index bfadfd6..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_aix_ppc64.go
+++ /dev/null
@@ -1,619 +0,0 @@
-// Copyright 2019 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-This program reads a file containing function prototypes
-(like syscall_aix.go) and generates system call bodies.
-The prototypes are marked by lines beginning with "//sys"
-and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-
-
-This program will generate three files and handle both gc and gccgo implementation:
- - zsyscall_aix_ppc64.go: the common part of each implementation (error handler, pointer creation)
- - zsyscall_aix_ppc64_gc.go: gc part with //go_cgo_import_dynamic and a call to syscall6
- - zsyscall_aix_ppc64_gccgo.go: gccgo part with C function and conversion to C type.
-
- The generated code looks like this
-
-zsyscall_aix_ppc64.go
-func asyscall(...) (n int, err error) {
- // Pointer Creation
- r1, e1 := callasyscall(...)
- // Type Conversion
- // Error Handler
- return
-}
-
-zsyscall_aix_ppc64_gc.go
-//go:cgo_import_dynamic libc_asyscall asyscall "libc.a/shr_64.o"
-//go:linkname libc_asyscall libc_asyscall
-var asyscall syscallFunc
-
-func callasyscall(...) (r1 uintptr, e1 Errno) {
- r1, _, e1 = syscall6(uintptr(unsafe.Pointer(&libc_asyscall)), "nb_args", ... )
- return
-}
-
-zsyscall_aix_ppc64_ggcgo.go
-
-// int asyscall(...)
-
-import "C"
-
-func callasyscall(...) (r1 uintptr, e1 Errno) {
- r1 = uintptr(C.asyscall(...))
- e1 = syscall.GetErrno()
- return
-}
-*/
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "io/ioutil"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- aix = flag.Bool("aix", false, "aix")
- tags = flag.String("tags", "", "build tags")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_aix_ppc64.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return strings.ReplaceAll(*tags, ",", " && ")
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_aix_ppc64.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- // GCCGO
- textgccgo := ""
- cExtern := "/*\n#include \n"
- // GC
- textgc := ""
- dynimports := ""
- linknames := ""
- var vars []string
- // COMMON
- textcommon := ""
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- if sysname == "" {
- sysname = funct
- }
-
- onlyCommon := false
- if funct == "readlen" || funct == "writelen" || funct == "FcntlInt" || funct == "FcntlFlock" {
- // This function call another syscall which is already implemented.
- // Therefore, the gc and gccgo part must not be generated.
- onlyCommon = true
- }
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
-
- textcommon += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- if !onlyCommon {
- textgccgo += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- textgc += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
- }
-
- // Check if value return, err return available
- errvar := ""
- rettype := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- } else {
- rettype = p.Type
- }
- }
-
- sysname = regexp.MustCompile(`([a-z])([A-Z])`).ReplaceAllString(sysname, `${1}_$2`)
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- // GCCGO Prototype return type
- cRettype := ""
- if rettype == "unsafe.Pointer" {
- cRettype = "uintptr_t"
- } else if rettype == "uintptr" {
- cRettype = "uintptr_t"
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(rettype) != nil {
- cRettype = "uintptr_t"
- } else if rettype == "int" {
- cRettype = "int"
- } else if rettype == "int32" {
- cRettype = "int"
- } else if rettype == "int64" {
- cRettype = "long long"
- } else if rettype == "uint32" {
- cRettype = "unsigned int"
- } else if rettype == "uint64" {
- cRettype = "unsigned long long"
- } else {
- cRettype = "int"
- }
- if sysname == "exit" {
- cRettype = "void"
- }
-
- // GCCGO Prototype arguments type
- var cIn []string
- for i, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "string" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t", "size_t")
- } else if p.Type == "unsafe.Pointer" {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "uintptr" {
- cIn = append(cIn, "uintptr_t")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil {
- cIn = append(cIn, "uintptr_t")
- } else if p.Type == "int" {
- if (i == 0 || i == 2) && funct == "fcntl" {
- // These fcntl arguments needs to be uintptr to be able to call FcntlInt and FcntlFlock
- cIn = append(cIn, "uintptr_t")
- } else {
- cIn = append(cIn, "int")
- }
-
- } else if p.Type == "int32" {
- cIn = append(cIn, "int")
- } else if p.Type == "int64" {
- cIn = append(cIn, "long long")
- } else if p.Type == "uint32" {
- cIn = append(cIn, "unsigned int")
- } else if p.Type == "uint64" {
- cIn = append(cIn, "unsigned long long")
- } else {
- cIn = append(cIn, "int")
- }
- }
-
- if !onlyCommon {
- // GCCGO Prototype Generation
- // Imports of system calls from libc
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- cExtern += "#define c_select select\n"
- }
- cExtern += fmt.Sprintf("%s %s", cRettype, sysname)
- cIn := strings.Join(cIn, ", ")
- cExtern += fmt.Sprintf("(%s);\n", cIn)
- }
- // GC Library name
- if modname == "" {
- modname = "libc.a/shr_64.o"
- } else {
- fmt.Fprintf(os.Stderr, "%s: only syscall using libc are available\n", funct)
- os.Exit(1)
- }
- sysvarname := fmt.Sprintf("libc_%s", sysname)
-
- if !onlyCommon {
- // GC Runtime import of function to allow cross-platform builds.
- dynimports += fmt.Sprintf("//go:cgo_import_dynamic %s %s \"%s\"\n", sysvarname, sysname, modname)
- // GC Link symbol to proc address variable.
- linknames += fmt.Sprintf("//go:linkname %s %s\n", sysvarname, sysvarname)
- // GC Library proc address variable.
- vars = append(vars, sysvarname)
- }
-
- strconvfunc := "BytePtrFromString"
- strconvtype := "*byte"
-
- // Go function header.
- if outps != "" {
- outps = fmt.Sprintf(" (%s)", outps)
- }
- if textcommon != "" {
- textcommon += "\n"
- }
-
- textcommon += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outps)
-
- // Prepare arguments tocall.
- var argscommon []string // Arguments in the common part
- var argscall []string // Arguments for call prototype
- var argsgc []string // Arguments for gc call (with syscall6)
- var argsgccgo []string // Arguments for gccgo call (with C.name_of_syscall)
- n := 0
- argN := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(%s))", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if p.Type == "string" && errvar != "" {
- textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
-
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr ", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- textcommon += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- textcommon += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- textcommon += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
-
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n))
- n++
- } else if m := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); m != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- textcommon += fmt.Sprintf("\tvar _p%d *%s\n", n, m[1])
- textcommon += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- argscommon = append(argscommon, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("len(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("_p%d uintptr", n), fmt.Sprintf("_lenp%d int", n))
- argsgc = append(argsgc, fmt.Sprintf("_p%d", n), fmt.Sprintf("uintptr(_lenp%d)", n))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(_p%d)", n), fmt.Sprintf("C.size_t(_lenp%d)", n))
- n++
- } else if p.Type == "int64" && endianness != "" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses int64 with 32 bits mode. Case not yet implemented\n")
- } else if p.Type == "bool" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses bool. Case not yet implemented\n")
- } else if regexp.MustCompile(`^_`).FindStringSubmatch(p.Type) != nil || p.Type == "unsafe.Pointer" {
- argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else if p.Type == "int" {
- if (argN == 0 || argN == 2) && ((funct == "fcntl") || (funct == "FcntlInt") || (funct == "FcntlFlock")) {
- // These fcntl arguments need to be uintptr to be able to call FcntlInt and FcntlFlock
- argscommon = append(argscommon, fmt.Sprintf("uintptr(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
-
- } else {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- }
- } else if p.Type == "int32" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int32", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- } else if p.Type == "int64" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s int64", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.longlong(%s)", p.Name))
- } else if p.Type == "uint32" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uint32", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uint(%s)", p.Name))
- } else if p.Type == "uint64" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uint64", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.ulonglong(%s)", p.Name))
- } else if p.Type == "uintptr" {
- argscommon = append(argscommon, p.Name)
- argscall = append(argscall, fmt.Sprintf("%s uintptr", p.Name))
- argsgc = append(argsgc, p.Name)
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.uintptr_t(%s)", p.Name))
- } else {
- argscommon = append(argscommon, fmt.Sprintf("int(%s)", p.Name))
- argscall = append(argscall, fmt.Sprintf("%s int", p.Name))
- argsgc = append(argsgc, fmt.Sprintf("uintptr(%s)", p.Name))
- argsgccgo = append(argsgccgo, fmt.Sprintf("C.int(%s)", p.Name))
- }
- argN++
- }
- nargs := len(argsgc)
-
- // COMMON function generation
- argscommonlist := strings.Join(argscommon, ", ")
- callcommon := fmt.Sprintf("call%s(%s)", sysname, argscommonlist)
- ret := []string{"_", "_"}
- body := ""
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- ret[1] = reg
- doErrno = true
- } else {
- reg = "r0"
- ret[0] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%s != 0", reg)
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" {
- textcommon += fmt.Sprintf("\t%s\n", callcommon)
- } else {
- textcommon += fmt.Sprintf("\t%s, %s := %s\n", ret[0], ret[1], callcommon)
- }
- textcommon += body
-
- if doErrno {
- textcommon += "\tif e1 != 0 {\n"
- textcommon += "\t\terr = errnoErr(e1)\n"
- textcommon += "\t}\n"
- }
- textcommon += "\treturn\n"
- textcommon += "}\n"
-
- if onlyCommon {
- continue
- }
-
- // CALL Prototype
- callProto := fmt.Sprintf("func call%s(%s) (r1 uintptr, e1 Errno) {\n", sysname, strings.Join(argscall, ", "))
-
- // GC function generation
- asm := "syscall6"
- if nonblock != nil {
- asm = "rawSyscall6"
- }
-
- if len(argsgc) <= 6 {
- for len(argsgc) < 6 {
- argsgc = append(argsgc, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s: too many arguments to system call", funct)
- os.Exit(1)
- }
- argsgclist := strings.Join(argsgc, ", ")
- callgc := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, argsgclist)
-
- textgc += callProto
- textgc += fmt.Sprintf("\tr1, _, e1 = %s\n", callgc)
- textgc += "\treturn\n}\n"
-
- // GCCGO function generation
- argsgccgolist := strings.Join(argsgccgo, ", ")
- var callgccgo string
- if sysname == "select" {
- // select is a keyword of Go. Its name is
- // changed to c_select.
- callgccgo = fmt.Sprintf("C.c_%s(%s)", sysname, argsgccgolist)
- } else {
- callgccgo = fmt.Sprintf("C.%s(%s)", sysname, argsgccgolist)
- }
- textgccgo += callProto
- textgccgo += fmt.Sprintf("\tr1 = uintptr(%s)\n", callgccgo)
- textgccgo += "\te1 = syscall.GetErrno()\n"
- textgccgo += "\treturn\n}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
-
- }
-
- // Print zsyscall_aix_ppc64.go
- err := ioutil.WriteFile("zsyscall_aix_ppc64.go",
- []byte(fmt.Sprintf(srcTemplate1, cmdLine(), goBuildTags(), plusBuildTags(), pack, imp, textcommon)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-
- // Print zsyscall_aix_ppc64_gc.go
- vardecls := "\t" + strings.Join(vars, ",\n\t")
- vardecls += " syscallFunc"
- err = ioutil.WriteFile("zsyscall_aix_ppc64_gc.go",
- []byte(fmt.Sprintf(srcTemplate2, cmdLine(), goBuildTags(), plusBuildTags(), pack, imp, dynimports, linknames, vardecls, textgc)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-
- // Print zsyscall_aix_ppc64_gccgo.go
- err = ioutil.WriteFile("zsyscall_aix_ppc64_gccgo.go",
- []byte(fmt.Sprintf(srcTemplate3, cmdLine(), goBuildTags(), plusBuildTags(), pack, cExtern, imp, textgccgo)),
- 0644)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
-}
-
-const srcTemplate1 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package %s
-
-import (
- "unsafe"
-)
-
-
-%s
-
-%s
-`
-const srcTemplate2 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s && gc
-// +build %s,gc
-
-package %s
-
-import (
- "unsafe"
-)
-%s
-%s
-%s
-type syscallFunc uintptr
-
-var (
-%s
-)
-
-// Implemented in runtime/syscall_aix.go.
-func rawSyscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-func syscall6(trap, nargs, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
-
-%s
-`
-const srcTemplate3 = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s && gccgo
-// +build %s,gccgo
-
-package %s
-
-%s
-*/
-import "C"
-import (
- "syscall"
-)
-
-
-%s
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go b/vendor/golang.org/x/sys/unix/mksyscall_solaris.go
deleted file mode 100644
index d5634b1..0000000
--- a/vendor/golang.org/x/sys/unix/mksyscall_solaris.go
+++ /dev/null
@@ -1,346 +0,0 @@
-// Copyright 2019 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.
-
-//go:build ignore
-// +build ignore
-
-/*
- This program reads a file containing function prototypes
- (like syscall_solaris.go) and generates system call bodies.
- The prototypes are marked by lines beginning with "//sys"
- and read like func declarations if //sys is replaced by func, but:
- * The parameter lists must give a name for each argument.
- This includes return parameters.
- * The parameter lists must give a type for each argument:
- the (x, y, z int) shorthand is not allowed.
- * If the return parameter is an error number, it must be named err.
- * If go func name needs to be different than its libc name,
- * or the function is not in libc, name could be specified
- * at the end, after "=" sign, like
- //sys getsockopt(s int, level int, name int, val uintptr, vallen *_Socklen) (err error) = libsocket.getsockopt
-*/
-
-package main
-
-import (
- "bufio"
- "flag"
- "fmt"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- b32 = flag.Bool("b32", false, "32bit big-endian")
- l32 = flag.Bool("l32", false, "32bit little-endian")
- tags = flag.String("tags", "", "build tags")
- illumos = flag.Bool("illumos", false, "illumos specific code generation")
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksyscall_solaris.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return strings.ReplaceAll(*tags, ",", " && ")
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return *tags
-}
-
-// Param is function parameter
-type Param struct {
- Name string
- Type string
-}
-
-// usage prints the program usage
-func usage() {
- fmt.Fprintf(os.Stderr, "usage: go run mksyscall_solaris.go [-b32 | -l32] [-tags x,y] [file ...]\n")
- os.Exit(1)
-}
-
-// parseParamList parses parameter list and returns a slice of parameters
-func parseParamList(list string) []string {
- list = strings.TrimSpace(list)
- if list == "" {
- return []string{}
- }
- return regexp.MustCompile(`\s*,\s*`).Split(list, -1)
-}
-
-// parseParam splits a parameter into name and type
-func parseParam(p string) Param {
- ps := regexp.MustCompile(`^(\S*) (\S*)$`).FindStringSubmatch(p)
- if ps == nil {
- fmt.Fprintf(os.Stderr, "malformed parameter: %s\n", p)
- os.Exit(1)
- }
- return Param{ps[1], ps[2]}
-}
-
-func main() {
- flag.Usage = usage
- flag.Parse()
- if len(flag.Args()) <= 0 {
- fmt.Fprintf(os.Stderr, "no files to parse provided\n")
- usage()
- }
-
- endianness := ""
- if *b32 {
- endianness = "big-endian"
- } else if *l32 {
- endianness = "little-endian"
- }
-
- pack := ""
- text := ""
- dynimports := ""
- linknames := ""
- var vars []string
- for _, path := range flag.Args() {
- file, err := os.Open(path)
- if err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- t := s.Text()
- if p := regexp.MustCompile(`^package (\S+)$`).FindStringSubmatch(t); p != nil && pack == "" {
- pack = p[1]
- }
- nonblock := regexp.MustCompile(`^\/\/sysnb\t`).FindStringSubmatch(t)
- if regexp.MustCompile(`^\/\/sys\t`).FindStringSubmatch(t) == nil && nonblock == nil {
- continue
- }
-
- // Line must be of the form
- // func Open(path string, mode int, perm int) (fd int, err error)
- // Split into name, in params, out params.
- f := regexp.MustCompile(`^\/\/sys(nb)?\t(\w+)\(([^()]*)\)\s*(?:\(([^()]+)\))?\s*(?:=\s*(?:(\w*)\.)?(\w*))?$`).FindStringSubmatch(t)
- if f == nil {
- fmt.Fprintf(os.Stderr, "%s:%s\nmalformed //sys declaration\n", path, t)
- os.Exit(1)
- }
- funct, inps, outps, modname, sysname := f[2], f[3], f[4], f[5], f[6]
-
- // Split argument lists on comma.
- in := parseParamList(inps)
- out := parseParamList(outps)
-
- inps = strings.Join(in, ", ")
- outps = strings.Join(out, ", ")
-
- // Try in vain to keep people from editing this file.
- // The theory is that they jump into the middle of the file
- // without reading the header.
- text += "// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT\n\n"
-
- // So file name.
- if modname == "" {
- modname = "libc"
- }
-
- // System call name.
- if sysname == "" {
- sysname = funct
- }
-
- // System call pointer variable name.
- sysvarname := fmt.Sprintf("proc%s", sysname)
-
- strconvfunc := "BytePtrFromString"
- strconvtype := "*byte"
-
- sysname = strings.ToLower(sysname) // All libc functions are lowercase.
-
- // Runtime import of function to allow cross-platform builds.
- dynimports += fmt.Sprintf("//go:cgo_import_dynamic libc_%s %s \"%s.so\"\n", sysname, sysname, modname)
- // Link symbol to proc address variable.
- linknames += fmt.Sprintf("//go:linkname %s libc_%s\n", sysvarname, sysname)
- // Library proc address variable.
- vars = append(vars, sysvarname)
-
- // Go function header.
- outlist := strings.Join(out, ", ")
- if outlist != "" {
- outlist = fmt.Sprintf(" (%s)", outlist)
- }
- if text != "" {
- text += "\n"
- }
- text += fmt.Sprintf("func %s(%s)%s {\n", funct, strings.Join(in, ", "), outlist)
-
- // Check if err return available
- errvar := ""
- for _, param := range out {
- p := parseParam(param)
- if p.Type == "error" {
- errvar = p.Name
- continue
- }
- }
-
- // Prepare arguments to Syscall.
- var args []string
- n := 0
- for _, param := range in {
- p := parseParam(param)
- if regexp.MustCompile(`^\*`).FindStringSubmatch(p.Type) != nil {
- args = append(args, "uintptr(unsafe.Pointer("+p.Name+"))")
- } else if p.Type == "string" && errvar != "" {
- text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- text += fmt.Sprintf("\t_p%d, %s = %s(%s)\n", n, errvar, strconvfunc, p.Name)
- text += fmt.Sprintf("\tif %s != nil {\n\t\treturn\n\t}\n", errvar)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if p.Type == "string" {
- fmt.Fprintf(os.Stderr, path+":"+funct+" uses string arguments, but has no error return\n")
- text += fmt.Sprintf("\tvar _p%d %s\n", n, strconvtype)
- text += fmt.Sprintf("\t_p%d, _ = %s(%s)\n", n, strconvfunc, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n))
- n++
- } else if s := regexp.MustCompile(`^\[\](.*)`).FindStringSubmatch(p.Type); s != nil {
- // Convert slice into pointer, length.
- // Have to be careful not to take address of &a[0] if len == 0:
- // pass nil in that case.
- text += fmt.Sprintf("\tvar _p%d *%s\n", n, s[1])
- text += fmt.Sprintf("\tif len(%s) > 0 {\n\t\t_p%d = &%s[0]\n\t}\n", p.Name, n, p.Name)
- args = append(args, fmt.Sprintf("uintptr(unsafe.Pointer(_p%d))", n), fmt.Sprintf("uintptr(len(%s))", p.Name))
- n++
- } else if p.Type == "int64" && endianness != "" {
- if endianness == "big-endian" {
- args = append(args, fmt.Sprintf("uintptr(%s>>32)", p.Name), fmt.Sprintf("uintptr(%s)", p.Name))
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name), fmt.Sprintf("uintptr(%s>>32)", p.Name))
- }
- } else if p.Type == "bool" {
- text += fmt.Sprintf("\tvar _p%d uint32\n", n)
- text += fmt.Sprintf("\tif %s {\n\t\t_p%d = 1\n\t} else {\n\t\t_p%d = 0\n\t}\n", p.Name, n, n)
- args = append(args, fmt.Sprintf("uintptr(_p%d)", n))
- n++
- } else {
- args = append(args, fmt.Sprintf("uintptr(%s)", p.Name))
- }
- }
- nargs := len(args)
-
- // Determine which form to use; pad args with zeros.
- asm := "sysvicall6"
- if nonblock != nil {
- asm = "rawSysvicall6"
- }
- if len(args) <= 6 {
- for len(args) < 6 {
- args = append(args, "0")
- }
- } else {
- fmt.Fprintf(os.Stderr, "%s: too many arguments to system call\n", path)
- os.Exit(1)
- }
-
- // Actual call.
- arglist := strings.Join(args, ", ")
- call := fmt.Sprintf("%s(uintptr(unsafe.Pointer(&%s)), %d, %s)", asm, sysvarname, nargs, arglist)
-
- // Assign return values.
- body := ""
- ret := []string{"_", "_", "_"}
- doErrno := false
- for i := 0; i < len(out); i++ {
- p := parseParam(out[i])
- reg := ""
- if p.Name == "err" {
- reg = "e1"
- ret[2] = reg
- doErrno = true
- } else {
- reg = fmt.Sprintf("r%d", i)
- ret[i] = reg
- }
- if p.Type == "bool" {
- reg = fmt.Sprintf("%d != 0", reg)
- }
- if p.Type == "int64" && endianness != "" {
- // 64-bit number in r1:r0 or r0:r1.
- if i+2 > len(out) {
- fmt.Fprintf(os.Stderr, "%s: not enough registers for int64 return\n", path)
- os.Exit(1)
- }
- if endianness == "big-endian" {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i, i+1)
- } else {
- reg = fmt.Sprintf("int64(r%d)<<32 | int64(r%d)", i+1, i)
- }
- ret[i] = fmt.Sprintf("r%d", i)
- ret[i+1] = fmt.Sprintf("r%d", i+1)
- }
- if reg != "e1" {
- body += fmt.Sprintf("\t%s = %s(%s)\n", p.Name, p.Type, reg)
- }
- }
- if ret[0] == "_" && ret[1] == "_" && ret[2] == "_" {
- text += fmt.Sprintf("\t%s\n", call)
- } else {
- text += fmt.Sprintf("\t%s, %s, %s := %s\n", ret[0], ret[1], ret[2], call)
- }
- text += body
-
- if doErrno {
- text += "\tif e1 != 0 {\n"
- text += "\t\terr = e1\n"
- text += "\t}\n"
- }
- text += "\treturn\n"
- text += "}\n"
- }
- if err := s.Err(); err != nil {
- fmt.Fprintf(os.Stderr, err.Error())
- os.Exit(1)
- }
- file.Close()
- }
- imp := ""
- if pack != "unix" {
- imp = "import \"golang.org/x/sys/unix\"\n"
- }
-
- syscallimp := ""
- if !*illumos {
- syscallimp = "\"syscall\""
- }
-
- vardecls := "\t" + strings.Join(vars, ",\n\t")
- vardecls += " syscallFunc"
- fmt.Printf(srcTemplate, cmdLine(), goBuildTags(), plusBuildTags(), pack, syscallimp, imp, dynimports, linknames, vardecls, text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package %s
-
-import (
- "unsafe"
- %s
-)
-%s
-%s
-%s
-var (
-%s
-)
-
-%s
-`
diff --git a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go b/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go
deleted file mode 100644
index 3fde87e..0000000
--- a/vendor/golang.org/x/sys/unix/mksysctl_openbsd.go
+++ /dev/null
@@ -1,358 +0,0 @@
-// Copyright 2019 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.
-
-//go:build ignore
-// +build ignore
-
-// Parse the header files for OpenBSD and generate a Go usable sysctl MIB.
-//
-// Build a MIB with each entry being an array containing the level, type and
-// a hash that will contain additional entries if the current entry is a node.
-// We then walk this MIB and create a flattened sysctl name to OID hash.
-
-package main
-
-import (
- "bufio"
- "fmt"
- "os"
- "path/filepath"
- "regexp"
- "sort"
- "strings"
-)
-
-var (
- goos, goarch string
-)
-
-// cmdLine returns this programs's commandline arguments.
-func cmdLine() string {
- return "go run mksysctl_openbsd.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return fmt.Sprintf("%s && %s", goarch, goos)
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return fmt.Sprintf("%s,%s", goarch, goos)
-}
-
-// reMatch performs regular expression match and stores the substring slice to value pointed by m.
-func reMatch(re *regexp.Regexp, str string, m *[]string) bool {
- *m = re.FindStringSubmatch(str)
- if *m != nil {
- return true
- }
- return false
-}
-
-type nodeElement struct {
- n int
- t string
- pE *map[string]nodeElement
-}
-
-var (
- debugEnabled bool
- mib map[string]nodeElement
- node *map[string]nodeElement
- nodeMap map[string]string
- sysCtl []string
-)
-
-var (
- ctlNames1RE = regexp.MustCompile(`^#define\s+(CTL_NAMES)\s+{`)
- ctlNames2RE = regexp.MustCompile(`^#define\s+(CTL_(.*)_NAMES)\s+{`)
- ctlNames3RE = regexp.MustCompile(`^#define\s+((.*)CTL_NAMES)\s+{`)
- netInetRE = regexp.MustCompile(`^netinet/`)
- netInet6RE = regexp.MustCompile(`^netinet6/`)
- netRE = regexp.MustCompile(`^net/`)
- bracesRE = regexp.MustCompile(`{.*}`)
- ctlTypeRE = regexp.MustCompile(`{\s+"(\w+)",\s+(CTLTYPE_[A-Z]+)\s+}`)
- fsNetKernRE = regexp.MustCompile(`^(fs|net|kern)_`)
-)
-
-func debug(s string) {
- if debugEnabled {
- fmt.Fprintln(os.Stderr, s)
- }
-}
-
-// Walk the MIB and build a sysctl name to OID mapping.
-func buildSysctl(pNode *map[string]nodeElement, name string, oid []int) {
- lNode := pNode // local copy of pointer to node
- var keys []string
- for k := range *lNode {
- keys = append(keys, k)
- }
- sort.Strings(keys)
-
- for _, key := range keys {
- nodename := name
- if name != "" {
- nodename += "."
- }
- nodename += key
-
- nodeoid := append(oid, (*pNode)[key].n)
-
- if (*pNode)[key].t == `CTLTYPE_NODE` {
- if _, ok := nodeMap[nodename]; ok {
- lNode = &mib
- ctlName := nodeMap[nodename]
- for _, part := range strings.Split(ctlName, ".") {
- lNode = ((*lNode)[part]).pE
- }
- } else {
- lNode = (*pNode)[key].pE
- }
- buildSysctl(lNode, nodename, nodeoid)
- } else if (*pNode)[key].t != "" {
- oidStr := []string{}
- for j := range nodeoid {
- oidStr = append(oidStr, fmt.Sprintf("%d", nodeoid[j]))
- }
- text := "\t{ \"" + nodename + "\", []_C_int{ " + strings.Join(oidStr, ", ") + " } }, \n"
- sysCtl = append(sysCtl, text)
- }
- }
-}
-
-func main() {
- // Get the OS (using GOOS_TARGET if it exist)
- goos = os.Getenv("GOOS_TARGET")
- if goos == "" {
- goos = os.Getenv("GOOS")
- }
- // Get the architecture (using GOARCH_TARGET if it exists)
- goarch = os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check if GOOS and GOARCH environment variables are defined
- if goarch == "" || goos == "" {
- fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n")
- os.Exit(1)
- }
-
- mib = make(map[string]nodeElement)
- headers := [...]string{
- `sys/sysctl.h`,
- `sys/socket.h`,
- `sys/tty.h`,
- `sys/malloc.h`,
- `sys/mount.h`,
- `sys/namei.h`,
- `sys/sem.h`,
- `sys/shm.h`,
- `sys/vmmeter.h`,
- `uvm/uvmexp.h`,
- `uvm/uvm_param.h`,
- `uvm/uvm_swap_encrypt.h`,
- `ddb/db_var.h`,
- `net/if.h`,
- `net/if_pfsync.h`,
- `net/pipex.h`,
- `netinet/in.h`,
- `netinet/icmp_var.h`,
- `netinet/igmp_var.h`,
- `netinet/ip_ah.h`,
- `netinet/ip_carp.h`,
- `netinet/ip_divert.h`,
- `netinet/ip_esp.h`,
- `netinet/ip_ether.h`,
- `netinet/ip_gre.h`,
- `netinet/ip_ipcomp.h`,
- `netinet/ip_ipip.h`,
- `netinet/tcp_var.h`,
- `netinet/udp_var.h`,
- `netinet6/in6.h`,
- `netinet6/ip6_divert.h`,
- `netinet/icmp6.h`,
- `netmpls/mpls.h`,
- }
-
- ctls := [...]string{
- `kern`,
- `vm`,
- `fs`,
- `net`,
- //debug /* Special handling required */
- `hw`,
- //machdep /* Arch specific */
- `user`,
- `ddb`,
- //vfs /* Special handling required */
- `fs.posix`,
- `kern.forkstat`,
- `kern.intrcnt`,
- `kern.malloc`,
- `kern.nchstats`,
- `kern.seminfo`,
- `kern.shminfo`,
- `kern.timecounter`,
- `kern.tty`,
- `kern.watchdog`,
- `net.bpf`,
- `net.ifq`,
- `net.inet`,
- `net.inet.ah`,
- `net.inet.carp`,
- `net.inet.divert`,
- `net.inet.esp`,
- `net.inet.etherip`,
- `net.inet.gre`,
- `net.inet.icmp`,
- `net.inet.igmp`,
- `net.inet.ip`,
- `net.inet.ip.ifq`,
- `net.inet.ipcomp`,
- `net.inet.ipip`,
- `net.inet.mobileip`,
- `net.inet.pfsync`,
- `net.inet.tcp`,
- `net.inet.udp`,
- `net.inet6`,
- `net.inet6.divert`,
- `net.inet6.ip6`,
- `net.inet6.icmp6`,
- `net.inet6.tcp6`,
- `net.inet6.udp6`,
- `net.mpls`,
- `net.mpls.ifq`,
- `net.key`,
- `net.pflow`,
- `net.pfsync`,
- `net.pipex`,
- `net.rt`,
- `vm.swapencrypt`,
- //vfsgenctl /* Special handling required */
- }
-
- // Node name "fixups"
- ctlMap := map[string]string{
- "ipproto": "net.inet",
- "net.inet.ipproto": "net.inet",
- "net.inet6.ipv6proto": "net.inet6",
- "net.inet6.ipv6": "net.inet6.ip6",
- "net.inet.icmpv6": "net.inet6.icmp6",
- "net.inet6.divert6": "net.inet6.divert",
- "net.inet6.tcp6": "net.inet.tcp",
- "net.inet6.udp6": "net.inet.udp",
- "mpls": "net.mpls",
- "swpenc": "vm.swapencrypt",
- }
-
- // Node mappings
- nodeMap = map[string]string{
- "net.inet.ip.ifq": "net.ifq",
- "net.inet.pfsync": "net.pfsync",
- "net.mpls.ifq": "net.ifq",
- }
-
- mCtls := make(map[string]bool)
- for _, ctl := range ctls {
- mCtls[ctl] = true
- }
-
- for _, header := range headers {
- debug("Processing " + header)
- file, err := os.Open(filepath.Join("/usr/include", header))
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
- s := bufio.NewScanner(file)
- for s.Scan() {
- var sub []string
- if reMatch(ctlNames1RE, s.Text(), &sub) ||
- reMatch(ctlNames2RE, s.Text(), &sub) ||
- reMatch(ctlNames3RE, s.Text(), &sub) {
- if sub[1] == `CTL_NAMES` {
- // Top level.
- node = &mib
- } else {
- // Node.
- nodename := strings.ToLower(sub[2])
- ctlName := ""
- if reMatch(netInetRE, header, &sub) {
- ctlName = "net.inet." + nodename
- } else if reMatch(netInet6RE, header, &sub) {
- ctlName = "net.inet6." + nodename
- } else if reMatch(netRE, header, &sub) {
- ctlName = "net." + nodename
- } else {
- ctlName = nodename
- ctlName = fsNetKernRE.ReplaceAllString(ctlName, `$1.`)
- }
-
- if val, ok := ctlMap[ctlName]; ok {
- ctlName = val
- }
- if _, ok := mCtls[ctlName]; !ok {
- debug("Ignoring " + ctlName + "...")
- continue
- }
-
- // Walk down from the top of the MIB.
- node = &mib
- for _, part := range strings.Split(ctlName, ".") {
- if _, ok := (*node)[part]; !ok {
- debug("Missing node " + part)
- (*node)[part] = nodeElement{n: 0, t: "", pE: &map[string]nodeElement{}}
- }
- node = (*node)[part].pE
- }
- }
-
- // Populate current node with entries.
- i := -1
- for !strings.HasPrefix(s.Text(), "}") {
- s.Scan()
- if reMatch(bracesRE, s.Text(), &sub) {
- i++
- }
- if !reMatch(ctlTypeRE, s.Text(), &sub) {
- continue
- }
- (*node)[sub[1]] = nodeElement{n: i, t: sub[2], pE: &map[string]nodeElement{}}
- }
- }
- }
- err = s.Err()
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
- file.Close()
- }
- buildSysctl(&mib, "", []int{})
-
- sort.Strings(sysCtl)
- text := strings.Join(sysCtl, "")
-
- fmt.Printf(srcTemplate, cmdLine(), goBuildTags(), plusBuildTags(), text)
-}
-
-const srcTemplate = `// %s
-// Code generated by the command above; DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package unix
-
-type mibentry struct {
- ctlname string
- ctloid []_C_int
-}
-
-var sysctlMib = []mibentry {
-%s
-}
-`
diff --git a/vendor/golang.org/x/sys/unix/mksysnum.go b/vendor/golang.org/x/sys/unix/mksysnum.go
deleted file mode 100644
index 812635f..0000000
--- a/vendor/golang.org/x/sys/unix/mksysnum.go
+++ /dev/null
@@ -1,190 +0,0 @@
-// 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.
-
-//go:build ignore
-// +build ignore
-
-// Generate system call table for DragonFly, NetBSD,
-// FreeBSD or OpenBSD from master list (for example,
-// /usr/src/sys/kern/syscalls.master or sys/syscall.h).
-package main
-
-import (
- "bufio"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "os"
- "regexp"
- "strings"
-)
-
-var (
- goos, goarch string
-)
-
-// cmdLine returns this programs's commandline arguments
-func cmdLine() string {
- return "go run mksysnum.go " + strings.Join(os.Args[1:], " ")
-}
-
-// goBuildTags returns build tags in the go:build format.
-func goBuildTags() string {
- return fmt.Sprintf("%s && %s", goarch, goos)
-}
-
-// plusBuildTags returns build tags in the +build format.
-func plusBuildTags() string {
- return fmt.Sprintf("%s,%s", goarch, goos)
-}
-
-func checkErr(err error) {
- if err != nil {
- fmt.Fprintf(os.Stderr, "%v\n", err)
- os.Exit(1)
- }
-}
-
-// source string and substring slice for regexp
-type re struct {
- str string // source string
- sub []string // matched sub-string
-}
-
-// Match performs regular expression match
-func (r *re) Match(exp string) bool {
- r.sub = regexp.MustCompile(exp).FindStringSubmatch(r.str)
- if r.sub != nil {
- return true
- }
- return false
-}
-
-// fetchFile fetches a text file from URL
-func fetchFile(URL string) io.Reader {
- resp, err := http.Get(URL)
- checkErr(err)
- defer resp.Body.Close()
- body, err := ioutil.ReadAll(resp.Body)
- checkErr(err)
- return strings.NewReader(string(body))
-}
-
-// readFile reads a text file from path
-func readFile(path string) io.Reader {
- file, err := os.Open(os.Args[1])
- checkErr(err)
- return file
-}
-
-func format(name, num, proto string) string {
- name = strings.ToUpper(name)
- // There are multiple entries for enosys and nosys, so comment them out.
- nm := re{str: name}
- if nm.Match(`^SYS_E?NOSYS$`) {
- name = fmt.Sprintf("// %s", name)
- }
- if name == `SYS_SYS_EXIT` {
- name = `SYS_EXIT`
- }
- return fmt.Sprintf(" %s = %s; // %s\n", name, num, proto)
-}
-
-func main() {
- // Get the OS (using GOOS_TARGET if it exist)
- goos = os.Getenv("GOOS_TARGET")
- if goos == "" {
- goos = os.Getenv("GOOS")
- }
- // Get the architecture (using GOARCH_TARGET if it exists)
- goarch = os.Getenv("GOARCH_TARGET")
- if goarch == "" {
- goarch = os.Getenv("GOARCH")
- }
- // Check if GOOS and GOARCH environment variables are defined
- if goarch == "" || goos == "" {
- fmt.Fprintf(os.Stderr, "GOARCH or GOOS not defined in environment\n")
- os.Exit(1)
- }
-
- file := strings.TrimSpace(os.Args[1])
- var syscalls io.Reader
- if strings.HasPrefix(file, "https://") || strings.HasPrefix(file, "http://") {
- // Download syscalls.master file
- syscalls = fetchFile(file)
- } else {
- syscalls = readFile(file)
- }
-
- var text, line string
- s := bufio.NewScanner(syscalls)
- for s.Scan() {
- t := re{str: line}
- if t.Match(`^(.*)\\$`) {
- // Handle continuation
- line = t.sub[1]
- line += strings.TrimLeft(s.Text(), " \t")
- } else {
- // New line
- line = s.Text()
- }
- t = re{str: line}
- if t.Match(`\\$`) {
- continue
- }
- t = re{str: line}
-
- switch goos {
- case "dragonfly":
- if t.Match(`^([0-9]+)\s+STD\s+({ \S+\s+(\w+).*)$`) {
- num, proto := t.sub[1], t.sub[2]
- name := fmt.Sprintf("SYS_%s", t.sub[3])
- text += format(name, num, proto)
- }
- case "freebsd":
- if t.Match(`^([0-9]+)\s+\S+\s+(?:(?:NO)?STD|COMPAT10)\s+({ \S+\s+(\w+).*)$`) {
- num, proto := t.sub[1], t.sub[2]
- name := fmt.Sprintf("SYS_%s", t.sub[3])
- text += format(name, num, proto)
- }
- case "openbsd":
- if t.Match(`^([0-9]+)\s+STD\s+(NOLOCK\s+)?({ \S+\s+\*?(\w+).*)$`) {
- num, proto, name := t.sub[1], t.sub[3], t.sub[4]
- text += format(name, num, proto)
- }
- case "netbsd":
- if t.Match(`^([0-9]+)\s+((STD)|(NOERR))\s+(RUMP\s+)?({\s+\S+\s*\*?\s*\|(\S+)\|(\S*)\|(\w+).*\s+})(\s+(\S+))?$`) {
- num, proto, compat := t.sub[1], t.sub[6], t.sub[8]
- name := t.sub[7] + "_" + t.sub[9]
- if t.sub[11] != "" {
- name = t.sub[7] + "_" + t.sub[11]
- }
- name = strings.ToUpper(name)
- if compat == "" || compat == "13" || compat == "30" || compat == "50" {
- text += fmt.Sprintf(" %s = %s; // %s\n", name, num, proto)
- }
- }
- default:
- fmt.Fprintf(os.Stderr, "unrecognized GOOS=%s\n", goos)
- os.Exit(1)
-
- }
- }
- err := s.Err()
- checkErr(err)
-
- fmt.Printf(template, cmdLine(), goBuildTags(), plusBuildTags(), text)
-}
-
-const template = `// %s
-// Code generated by the command above; see README.md. DO NOT EDIT.
-
-//go:build %s
-// +build %s
-
-package unix
-
-const(
-%s)`
diff --git a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
index 453a942..3865943 100644
--- a/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
+++ b/vendor/golang.org/x/sys/unix/sockcmsg_unix.go
@@ -52,6 +52,20 @@ func ParseSocketControlMessage(b []byte) ([]SocketControlMessage, error) {
return msgs, nil
}
+// ParseOneSocketControlMessage parses a single socket control message from b, returning the message header,
+// message data (a slice of b), and the remainder of b after that single message.
+// When there are no remaining messages, len(remainder) == 0.
+func ParseOneSocketControlMessage(b []byte) (hdr Cmsghdr, data []byte, remainder []byte, err error) {
+ h, dbuf, err := socketControlMessageHeaderAndData(b)
+ if err != nil {
+ return Cmsghdr{}, nil, nil, err
+ }
+ if i := cmsgAlignOf(int(h.Len)); i < len(b) {
+ remainder = b[i:]
+ }
+ return *h, dbuf, remainder, nil
+}
+
func socketControlMessageHeaderAndData(b []byte) (*Cmsghdr, []byte, error) {
h := (*Cmsghdr)(unsafe.Pointer(&b[0]))
if h.Len < SizeofCmsghdr || uint64(h.Len) > uint64(len(b)) {
diff --git a/vendor/golang.org/x/sys/unix/str.go b/vendor/golang.org/x/sys/unix/str.go
deleted file mode 100644
index 8ba89ed..0000000
--- a/vendor/golang.org/x/sys/unix/str.go
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2009 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.
-
-//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
-
-package unix
-
-func itoa(val int) string { // do it here rather than with fmt to avoid dependency
- if val < 0 {
- return "-" + uitoa(uint(-val))
- }
- return uitoa(uint(val))
-}
-
-func uitoa(val uint) string {
- var buf [32]byte // big enough for int64
- i := len(buf) - 1
- for val >= 10 {
- buf[i] = byte(val%10 + '0')
- i--
- val /= 10
- }
- buf[i] = byte(val + '0')
- return string(buf[i:])
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall.go b/vendor/golang.org/x/sys/unix/syscall.go
index 649fa87..63e8c83 100644
--- a/vendor/golang.org/x/sys/unix/syscall.go
+++ b/vendor/golang.org/x/sys/unix/syscall.go
@@ -29,8 +29,6 @@ import (
"bytes"
"strings"
"unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
)
// ByteSliceFromString returns a NUL-terminated slice of bytes
@@ -82,13 +80,7 @@ func BytePtrToString(p *byte) string {
ptr = unsafe.Pointer(uintptr(ptr) + 1)
}
- var s []byte
- h := (*unsafeheader.Slice)(unsafe.Pointer(&s))
- h.Data = unsafe.Pointer(p)
- h.Len = n
- h.Cap = n
-
- return string(s)
+ return string(unsafe.Slice(p, n))
}
// Single-word zero for use when we need a valid pointer to 0 bytes.
diff --git a/vendor/golang.org/x/sys/unix/syscall_aix.go b/vendor/golang.org/x/sys/unix/syscall_aix.go
index 4f55c8d..2db1b51 100644
--- a/vendor/golang.org/x/sys/unix/syscall_aix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_aix.go
@@ -37,6 +37,7 @@ func Creat(path string, mode uint32) (fd int, err error) {
}
//sys utimes(path string, times *[2]Timeval) (err error)
+
func Utimes(path string, tv []Timeval) error {
if len(tv) != 2 {
return EINVAL
@@ -45,6 +46,7 @@ func Utimes(path string, tv []Timeval) error {
}
//sys utimensat(dirfd int, path string, times *[2]Timespec, flag int) (err error)
+
func UtimesNano(path string, ts []Timespec) error {
if len(ts) != 2 {
return EINVAL
@@ -215,20 +217,63 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
return
}
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
- // Recvmsg not implemented on AIX
- sa := new(SockaddrUnix)
- return -1, -1, -1, sa, ENOSYS
-}
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
+func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
+ var msg Msghdr
+ msg.Name = (*byte)(unsafe.Pointer(rsa))
+ msg.Namelen = uint32(SizeofSockaddrAny)
+ var dummy byte
+ if len(oob) > 0 {
+ // receive at least one normal byte
+ if emptyIovecs(iov) {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
+ }
+ msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.SetControllen(len(oob))
+ }
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
+ if n, err = recvmsg(fd, &msg, flags); n == -1 {
+ return
+ }
+ oobn = int(msg.Controllen)
+ recvflags = int(msg.Flags)
return
}
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- // SendmsgN not implemented on AIX
- return -1, ENOSYS
+func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
+ var msg Msghdr
+ msg.Name = (*byte)(unsafe.Pointer(ptr))
+ msg.Namelen = uint32(salen)
+ var dummy byte
+ var empty bool
+ if len(oob) > 0 {
+ // send at least one normal byte
+ empty = emptyIovecs(iov)
+ if empty {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
+ }
+ msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
+ msg.SetControllen(len(oob))
+ }
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
+ if n, err = sendmsg(fd, &msg, flags); err != nil {
+ return 0, err
+ }
+ if len(oob) > 0 && empty {
+ n = 0
+ }
+ return n, nil
}
func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
@@ -306,11 +351,13 @@ func direntNamlen(buf []byte) (uint64, bool) {
}
//sys getdirent(fd int, buf []byte) (n int, err error)
+
func Getdents(fd int, buf []byte) (n int, err error) {
return getdirent(fd, buf)
}
//sys wait4(pid Pid_t, status *_C_int, options int, rusage *Rusage) (wpid Pid_t, err error)
+
func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int, err error) {
var status _C_int
var r Pid_t
@@ -378,6 +425,7 @@ func (w WaitStatus) TrapCause() int { return -1 }
//sys fcntl(fd int, cmd int, arg int) (val int, err error)
//sys fsyncRange(fd int, how int, start int64, length int64) (err error) = fsync_range
+
func Fsync(fd int) error {
return fsyncRange(fd, O_SYNC, 0, 0)
}
@@ -458,8 +506,8 @@ func Fsync(fd int) error {
//sys Listen(s int, n int) (err error)
//sys lstat(path string, stat *Stat_t) (err error)
//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error) = pread64
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64
+//sys pread(fd int, p []byte, offset int64) (n int, err error) = pread64
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error) = pwrite64
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error)
//sys Pselect(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timespec, sigmask *Sigset_t) (n int, err error)
//sysnb Setregid(rgid int, egid int) (err error)
@@ -542,6 +590,7 @@ func Poll(fds []PollFd, timeout int) (n int, err error) {
//sys Getsystemcfg(label int) (n uint64)
//sys umount(target string) (err error)
+
func Unmount(target string, flags int) (err error) {
if flags != 0 {
// AIX doesn't have any flags for umount.
diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go
index 0ce4523..eda4267 100644
--- a/vendor/golang.org/x/sys/unix/syscall_bsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go
@@ -325,80 +325,62 @@ func GetsockoptString(fd, level, opt int) (string, error) {
//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
+func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
+ msg.Name = (*byte)(unsafe.Pointer(rsa))
msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
var dummy byte
if len(oob) > 0 {
// receive at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ if emptyIovecs(iov) {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
msg.SetControllen(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = recvmsg(fd, &msg, flags); err != nil {
return
}
oobn = int(msg.Controllen)
recvflags = int(msg.Flags)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
return
}
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
+func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
var msg Msghdr
msg.Name = (*byte)(unsafe.Pointer(ptr))
msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*byte)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
var dummy byte
+ var empty bool
if len(oob) > 0 {
// send at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ empty = emptyIovecs(iov)
+ if empty {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
msg.SetControllen(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = sendmsg(fd, &msg, flags); err != nil {
return 0, err
}
- if len(oob) > 0 && len(p) == 0 {
+ if len(oob) > 0 && empty {
n = 0
}
return n, nil
@@ -571,12 +553,7 @@ func UtimesNano(path string, ts []Timespec) error {
if len(ts) != 2 {
return EINVAL
}
- // Darwin setattrlist can set nanosecond timestamps
- err := setattrlistTimes(path, ts, 0)
- if err != ENOSYS {
- return err
- }
- err = utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
+ err := utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
if err != ENOSYS {
return err
}
@@ -596,10 +573,6 @@ func UtimesNanoAt(dirfd int, path string, ts []Timespec, flags int) error {
if len(ts) != 2 {
return EINVAL
}
- err := setattrlistTimes(path, ts, flags)
- if err != ENOSYS {
- return err
- }
return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), flags)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
deleted file mode 100644
index b009860..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2019 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.
-
-//go:build darwin && go1.12 && !go1.13
-// +build darwin,go1.12,!go1.13
-
-package unix
-
-import (
- "unsafe"
-)
-
-const _SYS_GETDIRENTRIES64 = 344
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- // To implement this using libSystem we'd need syscall_syscallPtr for
- // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall
- // back to raw syscalls for this func on Go 1.12.
- var p unsafe.Pointer
- if len(buf) > 0 {
- p = unsafe.Pointer(&buf[0])
- } else {
- p = unsafe.Pointer(&_zero)
- }
- r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0)
- n = int(r0)
- if e1 != 0 {
- return n, errnoErr(e1)
- }
- return n, nil
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go b/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
deleted file mode 100644
index 1596426..0000000
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2019 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.
-
-//go:build darwin && go1.13
-// +build darwin,go1.13
-
-package unix
-
-import (
- "unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
-)
-
-//sys closedir(dir uintptr) (err error)
-//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
-
-func fdopendir(fd int) (dir uintptr, err error) {
- r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0)
- dir = uintptr(r0)
- if e1 != 0 {
- err = errnoErr(e1)
- }
- return
-}
-
-var libc_fdopendir_trampoline_addr uintptr
-
-//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
-
-func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- // Simulate Getdirentries using fdopendir/readdir_r/closedir.
- // We store the number of entries to skip in the seek
- // offset of fd. See issue #31368.
- // It's not the full required semantics, but should handle the case
- // of calling Getdirentries or ReadDirent repeatedly.
- // It won't handle assigning the results of lseek to *basep, or handle
- // the directory being edited underfoot.
- skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
- if err != nil {
- return 0, err
- }
-
- // We need to duplicate the incoming file descriptor
- // because the caller expects to retain control of it, but
- // fdopendir expects to take control of its argument.
- // Just Dup'ing the file descriptor is not enough, as the
- // result shares underlying state. Use Openat to make a really
- // new file descriptor referring to the same directory.
- fd2, err := Openat(fd, ".", O_RDONLY, 0)
- if err != nil {
- return 0, err
- }
- d, err := fdopendir(fd2)
- if err != nil {
- Close(fd2)
- return 0, err
- }
- defer closedir(d)
-
- var cnt int64
- for {
- var entry Dirent
- var entryp *Dirent
- e := readdir_r(d, &entry, &entryp)
- if e != 0 {
- return n, errnoErr(e)
- }
- if entryp == nil {
- break
- }
- if skip > 0 {
- skip--
- cnt++
- continue
- }
-
- reclen := int(entry.Reclen)
- if reclen > len(buf) {
- // Not enough room. Return for now.
- // The counter will let us know where we should start up again.
- // Note: this strategy for suspending in the middle and
- // restarting is O(n^2) in the length of the directory. Oh well.
- break
- }
-
- // Copy entry into return buffer.
- var s []byte
- hdr := (*unsafeheader.Slice)(unsafe.Pointer(&s))
- hdr.Data = unsafe.Pointer(&entry)
- hdr.Cap = reclen
- hdr.Len = reclen
- copy(buf, s)
-
- buf = buf[reclen:]
- n += reclen
- cnt++
- }
- // Set the seek offset of the input fd to record
- // how many files we've already returned.
- _, err = Seek(fd, cnt, 0 /* SEEK_SET */)
- if err != nil {
- return n, err
- }
-
- return n, nil
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go
index 0eaab91..1f63382 100644
--- a/vendor/golang.org/x/sys/unix/syscall_darwin.go
+++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go
@@ -19,6 +19,96 @@ import (
"unsafe"
)
+//sys closedir(dir uintptr) (err error)
+//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno)
+
+func fdopendir(fd int) (dir uintptr, err error) {
+ r0, _, e1 := syscall_syscallPtr(libc_fdopendir_trampoline_addr, uintptr(fd), 0, 0)
+ dir = uintptr(r0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
+var libc_fdopendir_trampoline_addr uintptr
+
+//go:cgo_import_dynamic libc_fdopendir fdopendir "/usr/lib/libSystem.B.dylib"
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ // Simulate Getdirentries using fdopendir/readdir_r/closedir.
+ // We store the number of entries to skip in the seek
+ // offset of fd. See issue #31368.
+ // It's not the full required semantics, but should handle the case
+ // of calling Getdirentries or ReadDirent repeatedly.
+ // It won't handle assigning the results of lseek to *basep, or handle
+ // the directory being edited underfoot.
+ skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
+ if err != nil {
+ return 0, err
+ }
+
+ // We need to duplicate the incoming file descriptor
+ // because the caller expects to retain control of it, but
+ // fdopendir expects to take control of its argument.
+ // Just Dup'ing the file descriptor is not enough, as the
+ // result shares underlying state. Use Openat to make a really
+ // new file descriptor referring to the same directory.
+ fd2, err := Openat(fd, ".", O_RDONLY, 0)
+ if err != nil {
+ return 0, err
+ }
+ d, err := fdopendir(fd2)
+ if err != nil {
+ Close(fd2)
+ return 0, err
+ }
+ defer closedir(d)
+
+ var cnt int64
+ for {
+ var entry Dirent
+ var entryp *Dirent
+ e := readdir_r(d, &entry, &entryp)
+ if e != 0 {
+ return n, errnoErr(e)
+ }
+ if entryp == nil {
+ break
+ }
+ if skip > 0 {
+ skip--
+ cnt++
+ continue
+ }
+
+ reclen := int(entry.Reclen)
+ if reclen > len(buf) {
+ // Not enough room. Return for now.
+ // The counter will let us know where we should start up again.
+ // Note: this strategy for suspending in the middle and
+ // restarting is O(n^2) in the length of the directory. Oh well.
+ break
+ }
+
+ // Copy entry into return buffer.
+ s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen)
+ copy(buf, s)
+
+ buf = buf[reclen:]
+ n += reclen
+ cnt++
+ }
+ // Set the seek offset of the input fd to record
+ // how many files we've already returned.
+ _, err = Seek(fd, cnt, 0 /* SEEK_SET */)
+ if err != nil {
+ return n, err
+ }
+
+ return n, nil
+}
+
// SockaddrDatalink implements the Sockaddr interface for AF_LINK type sockets.
type SockaddrDatalink struct {
Len uint8
@@ -141,16 +231,6 @@ func direntNamlen(buf []byte) (uint64, bool) {
func PtraceAttach(pid int) (err error) { return ptrace(PT_ATTACH, pid, 0, 0) }
func PtraceDetach(pid int) (err error) { return ptrace(PT_DETACH, pid, 0, 0) }
-type attrList struct {
- bitmapCount uint16
- _ uint16
- CommonAttr uint32
- VolAttr uint32
- DirAttr uint32
- FileAttr uint32
- Forkattr uint32
-}
-
//sysnb pipe(p *[2]int32) (err error)
func Pipe(p []int) (err error) {
@@ -282,36 +362,7 @@ func Flistxattr(fd int, dest []byte) (sz int, err error) {
return flistxattr(fd, xattrPointer(dest), len(dest), 0)
}
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- _p0, err := BytePtrFromString(path)
- if err != nil {
- return err
- }
-
- var attrList attrList
- attrList.bitmapCount = ATTR_BIT_MAP_COUNT
- attrList.CommonAttr = ATTR_CMN_MODTIME | ATTR_CMN_ACCTIME
-
- // order is mtime, atime: the opposite of Chtimes
- attributes := [2]Timespec{times[1], times[0]}
- options := 0
- if flags&AT_SYMLINK_NOFOLLOW != 0 {
- options |= FSOPT_NOFOLLOW
- }
- return setattrlist(
- _p0,
- unsafe.Pointer(&attrList),
- unsafe.Pointer(&attributes),
- unsafe.Sizeof(attributes),
- options)
-}
-
-//sys setattrlist(path *byte, list unsafe.Pointer, buf unsafe.Pointer, size uintptr, options int) (err error)
-
-func utimensat(dirfd int, path string, times *[2]Timespec, flags int) error {
- // Darwin doesn't support SYS_UTIMENSAT
- return ENOSYS
-}
+//sys utimensat(dirfd int, path string, times *[2]Timespec, flags int) (err error)
/*
* Wrapped
@@ -432,6 +483,13 @@ func GetsockoptXucred(fd, level, opt int) (*Xucred, error) {
return x, err
}
+func GetsockoptTCPConnectionInfo(fd, level, opt int) (*TCPConnectionInfo, error) {
+ var value TCPConnectionInfo
+ vallen := _Socklen(SizeofTCPConnectionInfo)
+ err := getsockopt(fd, level, opt, unsafe.Pointer(&value), &vallen)
+ return &value, err
+}
+
func SysctlKinfoProc(name string, args ...int) (*KinfoProc, error) {
mib, err := sysctlmib(name, args...)
if err != nil {
@@ -543,11 +601,12 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mkfifo(path string, mode uint32) (err error)
//sys Mknod(path string, mode uint32, dev int) (err error)
+//sys Mount(fsType string, dir string, flags int, data unsafe.Pointer) (err error)
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys pread(fd int, p []byte, offset int64) (n int, err error)
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
@@ -611,7 +670,6 @@ func SysctlKinfoProcSlice(name string, args ...int) ([]KinfoProc, error) {
// Nfssvc
// Getfh
// Quotactl
-// Mount
// Csops
// Waitid
// Add_profil
diff --git a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
index 2e37c31..a41111a 100644
--- a/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
+++ b/vendor/golang.org/x/sys/unix/syscall_dragonfly.go
@@ -125,12 +125,14 @@ func Pipe2(p []int, flags int) (err error) {
}
//sys extpread(fd int, p []byte, flags int, offset int64) (n int, err error)
-func Pread(fd int, p []byte, offset int64) (n int, err error) {
+
+func pread(fd int, p []byte, offset int64) (n int, err error) {
return extpread(fd, p, 0, offset)
}
//sys extpwrite(fd int, p []byte, flags int, offset int64) (n int, err error)
-func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
+
+func pwrite(fd int, p []byte, offset int64) (n int, err error) {
return extpwrite(fd, p, 0, offset)
}
@@ -169,11 +171,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
return
}
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
@@ -258,6 +255,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
+//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd.go b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
index 2f650ae..d50b9dc 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd.go
@@ -17,25 +17,12 @@ import (
"unsafe"
)
-const (
- SYS_FSTAT_FREEBSD12 = 551 // { int fstat(int fd, _Out_ struct stat *sb); }
- SYS_FSTATAT_FREEBSD12 = 552 // { int fstatat(int fd, _In_z_ char *path, \
- SYS_GETDIRENTRIES_FREEBSD12 = 554 // { ssize_t getdirentries(int fd, \
- SYS_STATFS_FREEBSD12 = 555 // { int statfs(_In_z_ char *path, \
- SYS_FSTATFS_FREEBSD12 = 556 // { int fstatfs(int fd, \
- SYS_GETFSSTAT_FREEBSD12 = 557 // { int getfsstat( \
- SYS_MKNODAT_FREEBSD12 = 559 // { int mknodat(int fd, _In_z_ char *path, \
-)
-
// See https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/versions.html.
var (
osreldateOnce sync.Once
osreldate uint32
)
-// INO64_FIRST from /usr/src/lib/libc/sys/compat-ino64.h
-const _ino64First = 1200031
-
func supportsABI(ver uint32) bool {
osreldateOnce.Do(func() { osreldate, _ = SysctlUint32("kern.osreldate") })
return osreldate >= ver
@@ -159,46 +146,21 @@ func Accept4(fd, flags int) (nfd int, sa Sockaddr, err error) {
func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
var (
- _p0 unsafe.Pointer
- bufsize uintptr
- oldBuf []statfs_freebsd11_t
- needsConvert bool
+ _p0 unsafe.Pointer
+ bufsize uintptr
)
-
if len(buf) > 0 {
- if supportsABI(_ino64First) {
- _p0 = unsafe.Pointer(&buf[0])
- bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
- } else {
- n := len(buf)
- oldBuf = make([]statfs_freebsd11_t, n)
- _p0 = unsafe.Pointer(&oldBuf[0])
- bufsize = unsafe.Sizeof(statfs_freebsd11_t{}) * uintptr(n)
- needsConvert = true
- }
+ _p0 = unsafe.Pointer(&buf[0])
+ bufsize = unsafe.Sizeof(Statfs_t{}) * uintptr(len(buf))
}
- var sysno uintptr = SYS_GETFSSTAT
- if supportsABI(_ino64First) {
- sysno = SYS_GETFSSTAT_FREEBSD12
- }
- r0, _, e1 := Syscall(sysno, uintptr(_p0), bufsize, uintptr(flags))
+ r0, _, e1 := Syscall(SYS_GETFSSTAT, uintptr(_p0), bufsize, uintptr(flags))
n = int(r0)
if e1 != 0 {
err = e1
}
- if e1 == 0 && needsConvert {
- for i := range oldBuf {
- buf[i].convertFrom(&oldBuf[i])
- }
- }
return
}
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
@@ -250,87 +212,11 @@ func Uname(uname *Utsname) error {
}
func Stat(path string, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(AT_FDCWD, path, st, 0)
- }
- err = stat(path, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
+ return Fstatat(AT_FDCWD, path, st, 0)
}
func Lstat(path string, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW)
- }
- err = lstat(path, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Fstat(fd int, st *Stat_t) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstat_freebsd12(fd, st)
- }
- err = fstat(fd, &oldStat)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Fstatat(fd int, path string, st *Stat_t, flags int) (err error) {
- var oldStat stat_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatat_freebsd12(fd, path, st, flags)
- }
- err = fstatat(fd, path, &oldStat, flags)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStat)
- return nil
-}
-
-func Statfs(path string, st *Statfs_t) (err error) {
- var oldStatfs statfs_freebsd11_t
- if supportsABI(_ino64First) {
- return statfs_freebsd12(path, st)
- }
- err = statfs(path, &oldStatfs)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStatfs)
- return nil
-}
-
-func Fstatfs(fd int, st *Statfs_t) (err error) {
- var oldStatfs statfs_freebsd11_t
- if supportsABI(_ino64First) {
- return fstatfs_freebsd12(fd, st)
- }
- err = fstatfs(fd, &oldStatfs)
- if err != nil {
- return err
- }
-
- st.convertFrom(&oldStatfs)
- return nil
+ return Fstatat(AT_FDCWD, path, st, AT_SYMLINK_NOFOLLOW)
}
func Getdents(fd int, buf []byte) (n int, err error) {
@@ -338,162 +224,25 @@ func Getdents(fd int, buf []byte) (n int, err error) {
}
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
- if supportsABI(_ino64First) {
- if basep == nil || unsafe.Sizeof(*basep) == 8 {
- return getdirentries_freebsd12(fd, buf, (*uint64)(unsafe.Pointer(basep)))
- }
- // The freebsd12 syscall needs a 64-bit base. On 32-bit machines
- // we can't just use the basep passed in. See #32498.
- var base uint64 = uint64(*basep)
- n, err = getdirentries_freebsd12(fd, buf, &base)
- *basep = uintptr(base)
- if base>>32 != 0 {
- // We can't stuff the base back into a uintptr, so any
- // future calls would be suspect. Generate an error.
- // EIO is allowed by getdirentries.
- err = EIO
- }
- return
+ if basep == nil || unsafe.Sizeof(*basep) == 8 {
+ return getdirentries(fd, buf, (*uint64)(unsafe.Pointer(basep)))
}
-
- // The old syscall entries are smaller than the new. Use 1/4 of the original
- // buffer size rounded up to DIRBLKSIZ (see /usr/src/lib/libc/sys/getdirentries.c).
- oldBufLen := roundup(len(buf)/4, _dirblksiz)
- oldBuf := make([]byte, oldBufLen)
- n, err = getdirentries(fd, oldBuf, basep)
- if err == nil && n > 0 {
- n = convertFromDirents11(buf, oldBuf[:n])
+ // The syscall needs a 64-bit base. On 32-bit machines
+ // we can't just use the basep passed in. See #32498.
+ var base uint64 = uint64(*basep)
+ n, err = getdirentries(fd, buf, &base)
+ *basep = uintptr(base)
+ if base>>32 != 0 {
+ // We can't stuff the base back into a uintptr, so any
+ // future calls would be suspect. Generate an error.
+ // EIO is allowed by getdirentries.
+ err = EIO
}
return
}
func Mknod(path string, mode uint32, dev uint64) (err error) {
- var oldDev int
- if supportsABI(_ino64First) {
- return mknodat_freebsd12(AT_FDCWD, path, mode, dev)
- }
- oldDev = int(dev)
- return mknod(path, mode, oldDev)
-}
-
-func Mknodat(fd int, path string, mode uint32, dev uint64) (err error) {
- var oldDev int
- if supportsABI(_ino64First) {
- return mknodat_freebsd12(fd, path, mode, dev)
- }
- oldDev = int(dev)
- return mknodat(fd, path, mode, oldDev)
-}
-
-// round x to the nearest multiple of y, larger or equal to x.
-//
-// from /usr/include/sys/param.h Macros for counting and rounding.
-// #define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-func roundup(x, y int) int {
- return ((x + y - 1) / y) * y
-}
-
-func (s *Stat_t) convertFrom(old *stat_freebsd11_t) {
- *s = Stat_t{
- Dev: uint64(old.Dev),
- Ino: uint64(old.Ino),
- Nlink: uint64(old.Nlink),
- Mode: old.Mode,
- Uid: old.Uid,
- Gid: old.Gid,
- Rdev: uint64(old.Rdev),
- Atim: old.Atim,
- Mtim: old.Mtim,
- Ctim: old.Ctim,
- Btim: old.Btim,
- Size: old.Size,
- Blocks: old.Blocks,
- Blksize: old.Blksize,
- Flags: old.Flags,
- Gen: uint64(old.Gen),
- }
-}
-
-func (s *Statfs_t) convertFrom(old *statfs_freebsd11_t) {
- *s = Statfs_t{
- Version: _statfsVersion,
- Type: old.Type,
- Flags: old.Flags,
- Bsize: old.Bsize,
- Iosize: old.Iosize,
- Blocks: old.Blocks,
- Bfree: old.Bfree,
- Bavail: old.Bavail,
- Files: old.Files,
- Ffree: old.Ffree,
- Syncwrites: old.Syncwrites,
- Asyncwrites: old.Asyncwrites,
- Syncreads: old.Syncreads,
- Asyncreads: old.Asyncreads,
- // Spare
- Namemax: old.Namemax,
- Owner: old.Owner,
- Fsid: old.Fsid,
- // Charspare
- // Fstypename
- // Mntfromname
- // Mntonname
- }
-
- sl := old.Fstypename[:]
- n := clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Fstypename[:], old.Fstypename[:n])
-
- sl = old.Mntfromname[:]
- n = clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Mntfromname[:], old.Mntfromname[:n])
-
- sl = old.Mntonname[:]
- n = clen(*(*[]byte)(unsafe.Pointer(&sl)))
- copy(s.Mntonname[:], old.Mntonname[:n])
-}
-
-func convertFromDirents11(buf []byte, old []byte) int {
- const (
- fixedSize = int(unsafe.Offsetof(Dirent{}.Name))
- oldFixedSize = int(unsafe.Offsetof(dirent_freebsd11{}.Name))
- )
-
- dstPos := 0
- srcPos := 0
- for dstPos+fixedSize < len(buf) && srcPos+oldFixedSize < len(old) {
- var dstDirent Dirent
- var srcDirent dirent_freebsd11
-
- // If multiple direntries are written, sometimes when we reach the final one,
- // we may have cap of old less than size of dirent_freebsd11.
- copy((*[unsafe.Sizeof(srcDirent)]byte)(unsafe.Pointer(&srcDirent))[:], old[srcPos:])
-
- reclen := roundup(fixedSize+int(srcDirent.Namlen)+1, 8)
- if dstPos+reclen > len(buf) {
- break
- }
-
- dstDirent.Fileno = uint64(srcDirent.Fileno)
- dstDirent.Off = 0
- dstDirent.Reclen = uint16(reclen)
- dstDirent.Type = srcDirent.Type
- dstDirent.Pad0 = 0
- dstDirent.Namlen = uint16(srcDirent.Namlen)
- dstDirent.Pad1 = 0
-
- copy(dstDirent.Name[:], srcDirent.Name[:srcDirent.Namlen])
- copy(buf[dstPos:], (*[unsafe.Sizeof(dstDirent)]byte)(unsafe.Pointer(&dstDirent))[:])
- padding := buf[dstPos+fixedSize+int(dstDirent.Namlen) : dstPos+reclen]
- for i := range padding {
- padding[i] = 0
- }
-
- dstPos += int(dstDirent.Reclen)
- srcPos += int(srcDirent.Reclen)
- }
-
- return dstPos
+ return Mknodat(AT_FDCWD, path, mode, dev)
}
func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
@@ -506,31 +255,31 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys ptrace(request int, pid int, addr uintptr, data int) (err error)
func PtraceAttach(pid int) (err error) {
- return ptrace(PTRACE_ATTACH, pid, 0, 0)
+ return ptrace(PT_ATTACH, pid, 0, 0)
}
func PtraceCont(pid int, signal int) (err error) {
- return ptrace(PTRACE_CONT, pid, 1, signal)
+ return ptrace(PT_CONTINUE, pid, 1, signal)
}
func PtraceDetach(pid int) (err error) {
- return ptrace(PTRACE_DETACH, pid, 1, 0)
+ return ptrace(PT_DETACH, pid, 1, 0)
}
func PtraceGetFpRegs(pid int, fpregsout *FpReg) (err error) {
- return ptrace(PTRACE_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0)
+ return ptrace(PT_GETFPREGS, pid, uintptr(unsafe.Pointer(fpregsout)), 0)
}
func PtraceGetRegs(pid int, regsout *Reg) (err error) {
- return ptrace(PTRACE_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0)
+ return ptrace(PT_GETREGS, pid, uintptr(unsafe.Pointer(regsout)), 0)
}
func PtraceLwpEvents(pid int, enable int) (err error) {
- return ptrace(PTRACE_LWPEVENTS, pid, 0, enable)
+ return ptrace(PT_LWP_EVENTS, pid, 0, enable)
}
func PtraceLwpInfo(pid int, info uintptr) (err error) {
- return ptrace(PTRACE_LWPINFO, pid, info, int(unsafe.Sizeof(PtraceLwpInfoStruct{})))
+ return ptrace(PT_LWPINFO, pid, info, int(unsafe.Sizeof(PtraceLwpInfoStruct{})))
}
func PtracePeekData(pid int, addr uintptr, out []byte) (count int, err error) {
@@ -550,11 +299,11 @@ func PtracePokeText(pid int, addr uintptr, data []byte) (count int, err error) {
}
func PtraceSetRegs(pid int, regs *Reg) (err error) {
- return ptrace(PTRACE_SETREGS, pid, uintptr(unsafe.Pointer(regs)), 0)
+ return ptrace(PT_SETREGS, pid, uintptr(unsafe.Pointer(regs)), 0)
}
func PtraceSingleStep(pid int) (err error) {
- return ptrace(PTRACE_SINGLESTEP, pid, 1, 0)
+ return ptrace(PT_STEP, pid, 1, 0)
}
/*
@@ -570,6 +319,7 @@ func PtraceSingleStep(pid int) (err error) {
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
+//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
@@ -596,16 +346,12 @@ func PtraceSingleStep(pid int) (err error) {
//sys Fchownat(dirfd int, path string, uid int, gid int, flags int) (err error)
//sys Flock(fd int, how int) (err error)
//sys Fpathconf(fd int, name int) (val int, err error)
-//sys fstat(fd int, stat *stat_freebsd11_t) (err error)
-//sys fstat_freebsd12(fd int, stat *Stat_t) (err error)
-//sys fstatat(fd int, path string, stat *stat_freebsd11_t, flags int) (err error)
-//sys fstatat_freebsd12(fd int, path string, stat *Stat_t, flags int) (err error)
-//sys fstatfs(fd int, stat *statfs_freebsd11_t) (err error)
-//sys fstatfs_freebsd12(fd int, stat *Statfs_t) (err error)
+//sys Fstat(fd int, stat *Stat_t) (err error)
+//sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error)
+//sys Fstatfs(fd int, stat *Statfs_t) (err error)
//sys Fsync(fd int) (err error)
//sys Ftruncate(fd int, length int64) (err error)
-//sys getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error)
-//sys getdirentries_freebsd12(fd int, buf []byte, basep *uint64) (n int, err error)
+//sys getdirentries(fd int, buf []byte, basep *uint64) (n int, err error)
//sys Getdtablesize() (size int)
//sysnb Getegid() (egid int)
//sysnb Geteuid() (uid int)
@@ -627,19 +373,16 @@ func PtraceSingleStep(pid int) (err error) {
//sys Link(path string, link string) (err error)
//sys Linkat(pathfd int, path string, linkfd int, link string, flags int) (err error)
//sys Listen(s int, backlog int) (err error)
-//sys lstat(path string, stat *stat_freebsd11_t) (err error)
//sys Mkdir(path string, mode uint32) (err error)
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mkfifo(path string, mode uint32) (err error)
-//sys mknod(path string, mode uint32, dev int) (err error)
-//sys mknodat(fd int, path string, mode uint32, dev int) (err error)
-//sys mknodat_freebsd12(fd int, path string, mode uint32, dev uint64) (err error)
+//sys Mknodat(fd int, path string, mode uint32, dev uint64) (err error)
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(fdat int, path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys pread(fd int, p []byte, offset int64) (n int, err error)
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
@@ -663,9 +406,7 @@ func PtraceSingleStep(pid int) (err error) {
//sysnb Setsid() (pid int, err error)
//sysnb Settimeofday(tp *Timeval) (err error)
//sysnb Setuid(uid int) (err error)
-//sys stat(path string, stat *stat_freebsd11_t) (err error)
-//sys statfs(path string, stat *statfs_freebsd11_t) (err error)
-//sys statfs_freebsd12(path string, stat *Statfs_t) (err error)
+//sys Statfs(path string, stat *Statfs_t) (err error)
//sys Symlink(path string, link string) (err error)
//sys Symlinkat(oldpath string, newdirfd int, newpath string) (err error)
//sys Sync() (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
index 342fc32..b11ede8 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go
@@ -57,11 +57,11 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
- return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
+ return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
}
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
- ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
- err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
+ ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)}
+ err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
return int(ioDesc.Len), err
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
index a32d5aa..9ed8eec 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go
@@ -57,11 +57,11 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceGetFsBase(pid int, fsbase *int64) (err error) {
- return ptrace(PTRACE_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
+ return ptrace(PT_GETFSBASE, pid, uintptr(unsafe.Pointer(fsbase)), 0)
}
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
- ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
- err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
+ ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
+ err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
return int(ioDesc.Len), err
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
index 1e36d39..f8ac982 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go
@@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
- ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint32(countin)}
- err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
+ ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint32(countin)}
+ err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
return int(ioDesc.Len), err
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
index a09a153..8e93203 100644
--- a/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go
@@ -57,7 +57,7 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
- ioDesc := PtraceIoDesc{Op: int32(req), Offs: (*byte)(unsafe.Pointer(addr)), Addr: (*byte)(unsafe.Pointer(&out[0])), Len: uint64(countin)}
- err = ptrace(PTRACE_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
+ ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
+ err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
return int(ioDesc.Len), err
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
new file mode 100644
index 0000000..cbe1222
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go
@@ -0,0 +1,63 @@
+// Copyright 2022 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.
+
+//go:build riscv64 && freebsd
+// +build riscv64,freebsd
+
+package unix
+
+import (
+ "syscall"
+ "unsafe"
+)
+
+func setTimespec(sec, nsec int64) Timespec {
+ return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+ return Timeval{Sec: sec, Usec: usec}
+}
+
+func SetKevent(k *Kevent_t, fd, mode, flags int) {
+ k.Ident = uint64(fd)
+ k.Filter = int16(mode)
+ k.Flags = uint16(flags)
+}
+
+func (iov *Iovec) SetLen(length int) {
+ iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+ msghdr.Controllen = uint32(length)
+}
+
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = int32(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+ cmsg.Len = uint32(length)
+}
+
+func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) {
+ var writtenOut uint64 = 0
+ _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0)
+
+ written = int(writtenOut)
+
+ if e1 != 0 {
+ err = e1
+ }
+ return
+}
+
+func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno)
+
+func PtraceIO(req int, pid int, addr uintptr, out []byte, countin int) (count int, err error) {
+ ioDesc := PtraceIoDesc{Op: int32(req), Offs: uintptr(unsafe.Pointer(addr)), Addr: uintptr(unsafe.Pointer(&out[0])), Len: uint64(countin)}
+ err = ptrace(PT_IO, pid, uintptr(unsafe.Pointer(&ioDesc)), 0)
+ return int(ioDesc.Len), err
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd.go b/vendor/golang.org/x/sys/unix/syscall_hurd.go
new file mode 100644
index 0000000..4ffb648
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_hurd.go
@@ -0,0 +1,22 @@
+// Copyright 2022 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.
+
+//go:build hurd
+// +build hurd
+
+package unix
+
+/*
+#include
+int ioctl(int, unsigned long int, uintptr_t);
+*/
+import "C"
+
+func ioctl(fd int, req uint, arg uintptr) (err error) {
+ r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg))
+ if r0 == -1 && er != nil {
+ err = er
+ }
+ return
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_hurd_386.go b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go
new file mode 100644
index 0000000..7cf54a3
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_hurd_386.go
@@ -0,0 +1,29 @@
+// Copyright 2022 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.
+
+//go:build 386 && hurd
+// +build 386,hurd
+
+package unix
+
+const (
+ TIOCGETA = 0x62251713
+)
+
+type Winsize struct {
+ Row uint16
+ Col uint16
+ Xpixel uint16
+ Ypixel uint16
+}
+
+type Termios struct {
+ Iflag uint32
+ Oflag uint32
+ Cflag uint32
+ Lflag uint32
+ Cc [20]uint8
+ Ispeed int32
+ Ospeed int32
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_illumos.go b/vendor/golang.org/x/sys/unix/syscall_illumos.go
index 8d5f294..87db5a6 100644
--- a/vendor/golang.org/x/sys/unix/syscall_illumos.go
+++ b/vendor/golang.org/x/sys/unix/syscall_illumos.go
@@ -10,8 +10,6 @@
package unix
import (
- "fmt"
- "runtime"
"unsafe"
)
@@ -20,10 +18,9 @@ func bytes2iovec(bs [][]byte) []Iovec {
for i, b := range bs {
iovecs[i].SetLen(len(b))
if len(b) > 0 {
- // somehow Iovec.Base on illumos is (*int8), not (*byte)
- iovecs[i].Base = (*int8)(unsafe.Pointer(&b[0]))
+ iovecs[i].Base = &b[0]
} else {
- iovecs[i].Base = (*int8)(unsafe.Pointer(&_zero))
+ iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero))
}
}
return iovecs
@@ -80,107 +77,3 @@ func Accept4(fd int, flags int) (nfd int, sa Sockaddr, err error) {
}
return
}
-
-//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error)
-
-func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) {
- var clp, datap *strbuf
- if len(cl) > 0 {
- clp = &strbuf{
- Len: int32(len(cl)),
- Buf: (*int8)(unsafe.Pointer(&cl[0])),
- }
- }
- if len(data) > 0 {
- datap = &strbuf{
- Len: int32(len(data)),
- Buf: (*int8)(unsafe.Pointer(&data[0])),
- }
- }
- return putmsg(fd, clp, datap, flags)
-}
-
-//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error)
-
-func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) {
- var clp, datap *strbuf
- if len(cl) > 0 {
- clp = &strbuf{
- Maxlen: int32(len(cl)),
- Buf: (*int8)(unsafe.Pointer(&cl[0])),
- }
- }
- if len(data) > 0 {
- datap = &strbuf{
- Maxlen: int32(len(data)),
- Buf: (*int8)(unsafe.Pointer(&data[0])),
- }
- }
-
- if err = getmsg(fd, clp, datap, &flags); err != nil {
- return nil, nil, 0, err
- }
-
- if len(cl) > 0 {
- retCl = cl[:clp.Len]
- }
- if len(data) > 0 {
- retData = data[:datap.Len]
- }
- return retCl, retData, flags, nil
-}
-
-func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
- return ioctlRet(fd, req, uintptr(arg))
-}
-
-func IoctlSetString(fd int, req uint, val string) error {
- bs := make([]byte, len(val)+1)
- copy(bs[:len(bs)-1], val)
- err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
- runtime.KeepAlive(&bs[0])
- return err
-}
-
-// Lifreq Helpers
-
-func (l *Lifreq) SetName(name string) error {
- if len(name) >= len(l.Name) {
- return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
- }
- for i := range name {
- l.Name[i] = int8(name[i])
- }
- return nil
-}
-
-func (l *Lifreq) SetLifruInt(d int) {
- *(*int)(unsafe.Pointer(&l.Lifru[0])) = d
-}
-
-func (l *Lifreq) GetLifruInt() int {
- return *(*int)(unsafe.Pointer(&l.Lifru[0]))
-}
-
-func (l *Lifreq) SetLifruUint(d uint) {
- *(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
-}
-
-func (l *Lifreq) GetLifruUint() uint {
- return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
-}
-
-func IoctlLifreq(fd int, req uint, l *Lifreq) error {
- return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
-}
-
-// Strioctl Helpers
-
-func (s *Strioctl) SetInt(i int) {
- s.Len = int32(unsafe.Sizeof(i))
- s.Dp = (*int8)(unsafe.Pointer(&i))
-}
-
-func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
- return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
-}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go
index f432b06..d839962 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux.go
@@ -13,7 +13,9 @@ package unix
import (
"encoding/binary"
+ "strconv"
"syscall"
+ "time"
"unsafe"
)
@@ -232,7 +234,7 @@ func Futimesat(dirfd int, path string, tv []Timeval) error {
func Futimes(fd int, tv []Timeval) (err error) {
// Believe it or not, this is the best we can do on Linux
// (and is what glibc does).
- return Utimes("/proc/self/fd/"+itoa(fd), tv)
+ return Utimes("/proc/self/fd/"+strconv.Itoa(fd), tv)
}
const ImplementsGetwd = true
@@ -249,6 +251,13 @@ func Getwd() (wd string, err error) {
if n < 1 || n > len(buf) || buf[n-1] != 0 {
return "", EINVAL
}
+ // In some cases, Linux can return a path that starts with the
+ // "(unreachable)" prefix, which can potentially be a valid relative
+ // path. To work around that, return ENOENT if path is not absolute.
+ if buf[0] != '/' {
+ return "", ENOENT
+ }
+
return string(buf[0 : n-1]), nil
}
@@ -358,6 +367,8 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
return
}
+//sys Waitid(idType int, id int, info *Siginfo, options int, rusage *Rusage) (err error)
+
func Mkfifo(path string, mode uint32) error {
return Mknod(path, mode|S_IFIFO, 0)
}
@@ -502,24 +513,24 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) {
//
// Server example:
//
-// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
-// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{
-// Channel: 1,
-// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00
-// })
-// _ = Listen(fd, 1)
-// nfd, sa, _ := Accept(fd)
-// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd)
-// Read(nfd, buf)
+// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
+// _ = unix.Bind(fd, &unix.SockaddrRFCOMM{
+// Channel: 1,
+// Addr: [6]uint8{0, 0, 0, 0, 0, 0}, // BDADDR_ANY or 00:00:00:00:00:00
+// })
+// _ = Listen(fd, 1)
+// nfd, sa, _ := Accept(fd)
+// fmt.Printf("conn addr=%v fd=%d", sa.(*unix.SockaddrRFCOMM).Addr, nfd)
+// Read(nfd, buf)
//
// Client example:
//
-// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
-// _ = Connect(fd, &SockaddrRFCOMM{
-// Channel: 1,
-// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11
-// })
-// Write(fd, []byte(`hello`))
+// fd, _ := Socket(AF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM)
+// _ = Connect(fd, &SockaddrRFCOMM{
+// Channel: 1,
+// Addr: [6]byte{0x11, 0x22, 0x33, 0xaa, 0xbb, 0xcc}, // CC:BB:AA:33:22:11
+// })
+// Write(fd, []byte(`hello`))
type SockaddrRFCOMM struct {
// Addr represents a bluetooth address, byte ordering is little-endian.
Addr [6]uint8
@@ -546,12 +557,12 @@ func (sa *SockaddrRFCOMM) sockaddr() (unsafe.Pointer, _Socklen, error) {
// The SockaddrCAN struct must be bound to the socket file descriptor
// using Bind before the CAN socket can be used.
//
-// // Read one raw CAN frame
-// fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW)
-// addr := &SockaddrCAN{Ifindex: index}
-// Bind(fd, addr)
-// frame := make([]byte, 16)
-// Read(fd, frame)
+// // Read one raw CAN frame
+// fd, _ := Socket(AF_CAN, SOCK_RAW, CAN_RAW)
+// addr := &SockaddrCAN{Ifindex: index}
+// Bind(fd, addr)
+// frame := make([]byte, 16)
+// Read(fd, frame)
//
// The full SocketCAN documentation can be found in the linux kernel
// archives at: https://www.kernel.org/doc/Documentation/networking/can.txt
@@ -622,13 +633,13 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) {
// Here is an example of using an AF_ALG socket with SHA1 hashing.
// The initial socket setup process is as follows:
//
-// // Open a socket to perform SHA1 hashing.
-// fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0)
-// addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"}
-// unix.Bind(fd, addr)
-// // Note: unix.Accept does not work at this time; must invoke accept()
-// // manually using unix.Syscall.
-// hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0)
+// // Open a socket to perform SHA1 hashing.
+// fd, _ := unix.Socket(unix.AF_ALG, unix.SOCK_SEQPACKET, 0)
+// addr := &unix.SockaddrALG{Type: "hash", Name: "sha1"}
+// unix.Bind(fd, addr)
+// // Note: unix.Accept does not work at this time; must invoke accept()
+// // manually using unix.Syscall.
+// hashfd, _, _ := unix.Syscall(unix.SYS_ACCEPT, uintptr(fd), 0, 0)
//
// Once a file descriptor has been returned from Accept, it may be used to
// perform SHA1 hashing. The descriptor is not safe for concurrent use, but
@@ -637,39 +648,39 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) {
// When hashing a small byte slice or string, a single Write and Read may
// be used:
//
-// // Assume hashfd is already configured using the setup process.
-// hash := os.NewFile(hashfd, "sha1")
-// // Hash an input string and read the results. Each Write discards
-// // previous hash state. Read always reads the current state.
-// b := make([]byte, 20)
-// for i := 0; i < 2; i++ {
-// io.WriteString(hash, "Hello, world.")
-// hash.Read(b)
-// fmt.Println(hex.EncodeToString(b))
-// }
-// // Output:
-// // 2ae01472317d1935a84797ec1983ae243fc6aa28
-// // 2ae01472317d1935a84797ec1983ae243fc6aa28
+// // Assume hashfd is already configured using the setup process.
+// hash := os.NewFile(hashfd, "sha1")
+// // Hash an input string and read the results. Each Write discards
+// // previous hash state. Read always reads the current state.
+// b := make([]byte, 20)
+// for i := 0; i < 2; i++ {
+// io.WriteString(hash, "Hello, world.")
+// hash.Read(b)
+// fmt.Println(hex.EncodeToString(b))
+// }
+// // Output:
+// // 2ae01472317d1935a84797ec1983ae243fc6aa28
+// // 2ae01472317d1935a84797ec1983ae243fc6aa28
//
// For hashing larger byte slices, or byte streams such as those read from
// a file or socket, use Sendto with MSG_MORE to instruct the kernel to update
// the hash digest instead of creating a new one for a given chunk and finalizing it.
//
-// // Assume hashfd and addr are already configured using the setup process.
-// hash := os.NewFile(hashfd, "sha1")
-// // Hash the contents of a file.
-// f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz")
-// b := make([]byte, 4096)
-// for {
-// n, err := f.Read(b)
-// if err == io.EOF {
-// break
-// }
-// unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr)
-// }
-// hash.Read(b)
-// fmt.Println(hex.EncodeToString(b))
-// // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5
+// // Assume hashfd and addr are already configured using the setup process.
+// hash := os.NewFile(hashfd, "sha1")
+// // Hash the contents of a file.
+// f, _ := os.Open("/tmp/linux-4.10-rc7.tar.xz")
+// b := make([]byte, 4096)
+// for {
+// n, err := f.Read(b)
+// if err == io.EOF {
+// break
+// }
+// unix.Sendto(hashfd, b[:n], unix.MSG_MORE, addr)
+// }
+// hash.Read(b)
+// fmt.Println(hex.EncodeToString(b))
+// // Output: 85cdcad0c06eef66f805ecce353bec9accbeecc5
//
// For more information, see: http://www.chronox.de/crypto-API/crypto/userspace-if.html.
type SockaddrALG struct {
@@ -1489,19 +1500,13 @@ func KeyctlRestrictKeyring(ringid int, keyType string, restriction string) error
//sys keyctlRestrictKeyringByType(cmd int, arg2 int, keyType string, restriction string) (err error) = SYS_KEYCTL
//sys keyctlRestrictKeyring(cmd int, arg2 int) (err error) = SYS_KEYCTL
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
+func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
+ msg.Name = (*byte)(unsafe.Pointer(rsa))
msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = &p[0]
- iov.SetLen(len(p))
- }
var dummy byte
if len(oob) > 0 {
- if len(p) == 0 {
+ if emptyIovecs(iov) {
var sockType int
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
if err != nil {
@@ -1509,53 +1514,36 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
}
// receive at least one normal byte
if sockType != SOCK_DGRAM {
- iov.Base = &dummy
- iov.SetLen(1)
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
}
msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = recvmsg(fd, &msg, flags); err != nil {
return
}
oobn = int(msg.Controllen)
recvflags = int(msg.Flags)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
return
}
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
- return
-}
-
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- var err error
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
+func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
var msg Msghdr
msg.Name = (*byte)(ptr)
msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = &p[0]
- iov.SetLen(len(p))
- }
var dummy byte
+ var empty bool
if len(oob) > 0 {
- if len(p) == 0 {
+ empty = emptyIovecs(iov)
+ if empty {
var sockType int
sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE)
if err != nil {
@@ -1563,19 +1551,23 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
}
// send at least one normal byte
if sockType != SOCK_DGRAM {
- iov.Base = &dummy
- iov.SetLen(1)
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
}
msg.Control = &oob[0]
msg.SetControllen(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = sendmsg(fd, &msg, flags); err != nil {
return 0, err
}
- if len(oob) > 0 && len(p) == 0 {
+ if len(oob) > 0 && empty {
n = 0
}
return n, nil
@@ -1838,6 +1830,9 @@ func Dup2(oldfd, newfd int) error {
//sys Fremovexattr(fd int, attr string) (err error)
//sys Fsetxattr(fd int, attr string, dest []byte, flags int) (err error)
//sys Fsync(fd int) (err error)
+//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error)
+//sys Fsopen(fsName string, flags int) (fd int, err error)
+//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
//sysnb Getpgid(pid int) (pgid int, err error)
@@ -1868,7 +1863,9 @@ func Getpgrp() (pid int) {
//sys MemfdCreate(name string, flags int) (fd int, err error)
//sys Mkdirat(dirfd int, path string, mode uint32) (err error)
//sys Mknodat(dirfd int, path string, mode uint32, dev int) (err error)
+//sys MoveMount(fromDirfd int, fromPathName string, toDirfd int, toPathName string, flags int) (err error)
//sys Nanosleep(time *Timespec, leftover *Timespec) (err error)
+//sys OpenTree(dfd int, fileName string, flags uint) (r int, 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
@@ -1896,17 +1893,28 @@ func PrctlRetInt(option int, arg2 uintptr, arg3 uintptr, arg4 uintptr, arg5 uint
return int(ret), nil
}
-// issue 1435.
-// On linux Setuid and Setgid only affects the current thread, not the process.
-// This does not match what most callers expect so we must return an error
-// here rather than letting the caller think that the call succeeded.
-
func Setuid(uid int) (err error) {
- return EOPNOTSUPP
+ return syscall.Setuid(uid)
}
-func Setgid(uid int) (err error) {
- return EOPNOTSUPP
+func Setgid(gid int) (err error) {
+ return syscall.Setgid(gid)
+}
+
+func Setreuid(ruid, euid int) (err error) {
+ return syscall.Setreuid(ruid, euid)
+}
+
+func Setregid(rgid, egid int) (err error) {
+ return syscall.Setregid(rgid, egid)
+}
+
+func Setresuid(ruid, euid, suid int) (err error) {
+ return syscall.Setresuid(ruid, euid, suid)
+}
+
+func Setresgid(rgid, egid, sgid int) (err error) {
+ return syscall.Setresgid(rgid, egid, sgid)
}
// SetfsgidRetGid sets fsgid for current thread and returns previous fsgid set.
@@ -1965,36 +1973,46 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) {
//sys preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2
//sys pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2
-func bytes2iovec(bs [][]byte) []Iovec {
- iovecs := make([]Iovec, len(bs))
- for i, b := range bs {
- iovecs[i].SetLen(len(b))
+// minIovec is the size of the small initial allocation used by
+// Readv, Writev, etc.
+//
+// This small allocation gets stack allocated, which lets the
+// common use case of len(iovs) <= minIovs avoid more expensive
+// heap allocations.
+const minIovec = 8
+
+// appendBytes converts bs to Iovecs and appends them to vecs.
+func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
+ for _, b := range bs {
+ var v Iovec
+ v.SetLen(len(b))
if len(b) > 0 {
- iovecs[i].Base = &b[0]
+ v.Base = &b[0]
} else {
- iovecs[i].Base = (*byte)(unsafe.Pointer(&_zero))
+ v.Base = (*byte)(unsafe.Pointer(&_zero))
}
+ vecs = append(vecs, v)
}
- return iovecs
+ return vecs
}
-// offs2lohi splits offs into its lower and upper unsigned long. On 64-bit
-// systems, hi will always be 0. On 32-bit systems, offs will be split in half.
-// preadv/pwritev chose this calling convention so they don't need to add a
-// padding-register for alignment on ARM.
+// offs2lohi splits offs into its low and high order bits.
func offs2lohi(offs int64) (lo, hi uintptr) {
- return uintptr(offs), uintptr(uint64(offs) >> SizeofLong)
+ const longBits = SizeofLong * 8
+ return uintptr(offs), uintptr(uint64(offs) >> longBits)
}
func Readv(fd int, iovs [][]byte) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRacedetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
lo, hi := offs2lohi(offset)
n, err = preadv(fd, iovecs, lo, hi)
readvRacedetect(iovecs, n, err)
@@ -2002,7 +2020,8 @@ func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
}
func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
lo, hi := offs2lohi(offset)
n, err = preadv2(fd, iovecs, lo, hi, flags)
readvRacedetect(iovecs, n, err)
@@ -2029,7 +2048,8 @@ func readvRacedetect(iovecs []Iovec, n int, err error) {
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
@@ -2039,7 +2059,8 @@ func Writev(fd int, iovs [][]byte) (n int, err error) {
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
@@ -2050,7 +2071,8 @@ func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
}
func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) {
- iovecs := bytes2iovec(iovs)
+ iovecs := make([]Iovec, 0, minIovec)
+ iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
@@ -2193,7 +2215,7 @@ func Faccessat(dirfd int, path string, mode uint32, flags int) (err error) {
gid = Getgid()
}
- if uint32(gid) == st.Gid || isGroupMember(gid) {
+ if uint32(gid) == st.Gid || isGroupMember(int(st.Gid)) {
fmode = (st.Mode >> 3) & 7
} else {
fmode = st.Mode & 7
@@ -2245,7 +2267,7 @@ func (fh *FileHandle) Bytes() []byte {
if n == 0 {
return nil
}
- return (*[1 << 30]byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type)) + 4))[:n:n]
+ return unsafe.Slice((*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(&fh.fileHandle.Type))+4)), n)
}
// NameToHandleAt wraps the name_to_handle_at system call; it obtains
@@ -2308,17 +2330,73 @@ type RemoteIovec struct {
//sys PidfdOpen(pid int, flags int) (fd int, err error) = SYS_PIDFD_OPEN
//sys PidfdGetfd(pidfd int, targetfd int, flags int) (fd int, err error) = SYS_PIDFD_GETFD
+//sys PidfdSendSignal(pidfd int, sig Signal, info *Siginfo, flags int) (err error) = SYS_PIDFD_SEND_SIGNAL
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
//sys shmctl(id int, cmd int, buf *SysvShmDesc) (result int, err error)
//sys shmdt(addr uintptr) (err error)
//sys shmget(key int, size int, flag int) (id int, err error)
+//sys getitimer(which int, currValue *Itimerval) (err error)
+//sys setitimer(which int, newValue *Itimerval, oldValue *Itimerval) (err error)
+
+// MakeItimerval creates an Itimerval from interval and value durations.
+func MakeItimerval(interval, value time.Duration) Itimerval {
+ return Itimerval{
+ Interval: NsecToTimeval(interval.Nanoseconds()),
+ Value: NsecToTimeval(value.Nanoseconds()),
+ }
+}
+
+// A value which may be passed to the which parameter for Getitimer and
+// Setitimer.
+type ItimerWhich int
+
+// Possible which values for Getitimer and Setitimer.
+const (
+ ItimerReal ItimerWhich = ITIMER_REAL
+ ItimerVirtual ItimerWhich = ITIMER_VIRTUAL
+ ItimerProf ItimerWhich = ITIMER_PROF
+)
+
+// Getitimer wraps getitimer(2) to return the current value of the timer
+// specified by which.
+func Getitimer(which ItimerWhich) (Itimerval, error) {
+ var it Itimerval
+ if err := getitimer(int(which), &it); err != nil {
+ return Itimerval{}, err
+ }
+
+ return it, nil
+}
+
+// Setitimer wraps setitimer(2) to arm or disarm the timer specified by which.
+// It returns the previous value of the timer.
+//
+// If the Itimerval argument is the zero value, the timer will be disarmed.
+func Setitimer(which ItimerWhich, it Itimerval) (Itimerval, error) {
+ var prev Itimerval
+ if err := setitimer(int(which), &it, &prev); err != nil {
+ return Itimerval{}, err
+ }
+
+ return prev, nil
+}
+
+//sysnb rtSigprocmask(how int, set *Sigset_t, oldset *Sigset_t, sigsetsize uintptr) (err error) = SYS_RT_SIGPROCMASK
+
+func PthreadSigmask(how int, set, oldset *Sigset_t) error {
+ if oldset != nil {
+ // Explicitly clear in case Sigset_t is larger than _C__NSIG.
+ *oldset = Sigset_t{}
+ }
+ return rtSigprocmask(how, set, oldset, _C__NSIG/8)
+}
+
/*
* Unimplemented
*/
// AfsSyscall
-// Alarm
// ArchPrctl
// Brk
// ClockNanosleep
@@ -2334,7 +2412,6 @@ type RemoteIovec struct {
// GetMempolicy
// GetRobustList
// GetThreadArea
-// Getitimer
// Getpmsg
// IoCancel
// IoDestroy
@@ -2374,7 +2451,6 @@ type RemoteIovec struct {
// RestartSyscall
// RtSigaction
// RtSigpending
-// RtSigprocmask
// RtSigqueueinfo
// RtSigreturn
// RtSigsuspend
@@ -2412,5 +2488,4 @@ type RemoteIovec struct {
// Vfork
// Vhangup
// Vserver
-// Waitid
// _Sysctl
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_386.go b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
index 5f757e8..ff5b589 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go
@@ -35,16 +35,12 @@ func setTimeval(sec, usec int64) Timeval {
//sys Iopl(level int) (err error)
//sys Lchown(path string, uid int, gid int) (err error) = SYS_LCHOWN32
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
-//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
-//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
-//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
@@ -173,14 +169,6 @@ const (
_SENDMMSG = 20
)
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error) {
- fd, e := socketcall(_ACCEPT, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), 0, 0, 0)
- if e != 0 {
- err = e
- }
- return
-}
-
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error) {
fd, e := socketcall(_ACCEPT4, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags), 0, 0)
if e != 0 {
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go b/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
new file mode 100644
index 0000000..08086ac
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go
@@ -0,0 +1,14 @@
+// Copyright 2022 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.
+
+//go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64)
+// +build linux
+// +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64
+
+package unix
+
+// SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH
+// values.
+
+//sys Alarm(seconds uint) (remaining uint, 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 4299125..9b27035 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go
@@ -28,9 +28,10 @@ func Lstat(path string, stat *Stat_t) (err error) {
return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
}
+//sys MemfdSecret(flags int) (fd int, err error)
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
@@ -45,11 +46,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//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)
@@ -62,7 +59,6 @@ func Stat(path string, stat *Stat_t) (err error) {
//sys SyncFileRange(fd int, off int64, n int64, flags int) (err error)
//sys Truncate(path string, length int64) (err error)
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
index 79edeb9..856ad1d 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go
@@ -27,7 +27,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
return newoffset, nil
}
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
@@ -63,10 +62,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) {
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
//sys setfsgid(gid int) (prev int, err error) = SYS_SETFSGID32
//sys setfsuid(uid int) (prev int, err error) = SYS_SETFSUID32
-//sysnb Setregid(rgid int, egid int) (err error) = SYS_SETREGID32
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error) = SYS_SETRESGID32
-//sysnb Setresuid(ruid int, euid int, suid int) (err error) = SYS_SETRESUID32
-//sysnb Setreuid(ruid int, euid int) (err error) = SYS_SETREUID32
//sys Shutdown(fd int, how int) (err error)
//sys Splice(rfd int, roff *int64, wfd int, woff *int64, len int, flags int) (n int, err error)
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
@@ -97,8 +92,8 @@ func Utime(path string, buf *Utimbuf) error {
//sys utimes(path string, times *[2]Timeval) (err error)
-//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 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 Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
//sys Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
index 862890d..6422704 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go
@@ -22,8 +22,9 @@ import "unsafe"
//sysnb getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
//sys Listen(s int, n int) (err error)
-//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 MemfdSecret(flags int) (fd int, err error)
+//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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
@@ -38,11 +39,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb setrlimit(resource int, rlim *Rlimit) (err error)
-//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)
@@ -66,7 +63,6 @@ func Ustat(dev int, ubuf *Ustat_t) (err error) {
return ENOSYS
}
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
new file mode 100644
index 0000000..59dab51
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go
@@ -0,0 +1,222 @@
+// Copyright 2022 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.
+
+//go:build loong64 && linux
+// +build loong64,linux
+
+package unix
+
+import "unsafe"
+
+//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT
+//sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64
+//sys Fchown(fd int, uid int, gid int) (err error)
+//sys Fstatfs(fd int, buf *Statfs_t) (err error)
+//sys Ftruncate(fd int, length int64) (err error)
+//sysnb Getegid() (egid int)
+//sysnb Geteuid() (euid int)
+//sysnb Getgid() (gid int)
+//sysnb Getuid() (uid int)
+//sys Listen(s int, n int) (err error)
+//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
+
+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) (prev int, err error)
+//sys setfsuid(uid int) (prev 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)
+
+func timespecFromStatxTimestamp(x StatxTimestamp) Timespec {
+ return Timespec{
+ Sec: x.Sec,
+ Nsec: int64(x.Nsec),
+ }
+}
+
+func Fstatat(fd int, path string, stat *Stat_t, flags int) error {
+ var r Statx_t
+ // Do it the glibc way, add AT_NO_AUTOMOUNT.
+ if err := Statx(fd, path, AT_NO_AUTOMOUNT|flags, STATX_BASIC_STATS, &r); err != nil {
+ return err
+ }
+
+ stat.Dev = Mkdev(r.Dev_major, r.Dev_minor)
+ stat.Ino = r.Ino
+ stat.Mode = uint32(r.Mode)
+ stat.Nlink = r.Nlink
+ stat.Uid = r.Uid
+ stat.Gid = r.Gid
+ stat.Rdev = Mkdev(r.Rdev_major, r.Rdev_minor)
+ // hope we don't get to process files so large to overflow these size
+ // fields...
+ stat.Size = int64(r.Size)
+ stat.Blksize = int32(r.Blksize)
+ stat.Blocks = int64(r.Blocks)
+ stat.Atim = timespecFromStatxTimestamp(r.Atime)
+ stat.Mtim = timespecFromStatxTimestamp(r.Mtime)
+ stat.Ctim = timespecFromStatxTimestamp(r.Ctime)
+
+ return nil
+}
+
+func Fstat(fd int, stat *Stat_t) (err error) {
+ return Fstatat(fd, "", stat, AT_EMPTY_PATH)
+}
+
+func Stat(path string, stat *Stat_t) (err error) {
+ return Fstatat(AT_FDCWD, path, stat, 0)
+}
+
+func Lchown(path string, uid int, gid int) (err error) {
+ return Fchownat(AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW)
+}
+
+func Lstat(path string, stat *Stat_t) (err error) {
+ return Fstatat(AT_FDCWD, path, stat, AT_SYMLINK_NOFOLLOW)
+}
+
+//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)
+
+func Ustat(dev int, ubuf *Ustat_t) (err error) {
+ return ENOSYS
+}
+
+//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
+//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
+//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
+//sysnb getgroups(n int, list *_Gid_t) (nn int, err error)
+//sysnb setgroups(n int, list *_Gid_t) (err error)
+//sys getsockopt(s int, level int, name int, val unsafe.Pointer, vallen *_Socklen) (err error)
+//sys setsockopt(s int, level int, name int, val unsafe.Pointer, vallen uintptr) (err error)
+//sysnb socket(domain int, typ int, proto int) (fd int, err error)
+//sysnb socketpair(domain int, typ int, proto int, fd *[2]int32) (err error)
+//sysnb getpeername(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sysnb getsockname(fd int, rsa *RawSockaddrAny, addrlen *_Socklen) (err error)
+//sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error)
+//sys sendto(s int, buf []byte, flags int, to unsafe.Pointer, addrlen _Socklen) (err error)
+//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error)
+//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error)
+//sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error)
+
+//sysnb Gettimeofday(tv *Timeval) (err error)
+
+func setTimespec(sec, nsec int64) Timespec {
+ return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+ return Timeval{Sec: sec, Usec: usec}
+}
+
+func Getrlimit(resource int, rlim *Rlimit) (err error) {
+ err = Prlimit(0, resource, nil, rlim)
+ return
+}
+
+func Setrlimit(resource int, rlim *Rlimit) (err error) {
+ err = Prlimit(0, resource, rlim, nil)
+ return
+}
+
+func futimesat(dirfd int, path string, tv *[2]Timeval) (err error) {
+ if tv == nil {
+ return utimensat(dirfd, path, nil, 0)
+ }
+
+ ts := []Timespec{
+ NsecToTimespec(TimevalToNsec(tv[0])),
+ NsecToTimespec(TimevalToNsec(tv[1])),
+ }
+ return utimensat(dirfd, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
+}
+
+func Time(t *Time_t) (Time_t, error) {
+ var tv Timeval
+ err := Gettimeofday(&tv)
+ if err != nil {
+ return 0, err
+ }
+ if t != nil {
+ *t = Time_t(tv.Sec)
+ }
+ return Time_t(tv.Sec), nil
+}
+
+func Utime(path string, buf *Utimbuf) error {
+ tv := []Timeval{
+ {Sec: buf.Actime},
+ {Sec: buf.Modtime},
+ }
+ return Utimes(path, tv)
+}
+
+func utimes(path string, tv *[2]Timeval) (err error) {
+ if tv == nil {
+ return utimensat(AT_FDCWD, path, nil, 0)
+ }
+
+ ts := []Timespec{
+ NsecToTimespec(TimevalToNsec(tv[0])),
+ NsecToTimespec(TimevalToNsec(tv[1])),
+ }
+ return utimensat(AT_FDCWD, path, (*[2]Timespec)(unsafe.Pointer(&ts[0])), 0)
+}
+
+func (r *PtraceRegs) PC() uint64 { return r.Era }
+
+func (r *PtraceRegs) SetPC(era uint64) { r.Era = era }
+
+func (iov *Iovec) SetLen(length int) {
+ iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+ msghdr.Controllen = uint64(length)
+}
+
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint64(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+ cmsg.Len = uint64(length)
+}
+
+func (rsa *RawSockaddrNFCLLCP) SetServiceNameLen(length int) {
+ rsa.Service_name_len = uint64(length)
+}
+
+func Pause() error {
+ _, err := ppoll(nil, 0, nil, nil)
+ return err
+}
+
+func Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error) {
+ return Renameat2(olddirfd, oldpath, newdirfd, newpath, 0)
+}
+
+//sys kexecFileLoad(kernelFd int, initrdFd int, cmdlineLen int, cmdline string, flags int) (err error)
+
+func KexecFileLoad(kernelFd int, initrdFd int, cmdline string, flags int) error {
+ cmdlineLen := len(cmdline)
+ if cmdlineLen > 0 {
+ // Account for the additional NULL byte added by
+ // BytePtrFromString in kexecFileLoad. The kexec_file_load
+ // syscall expects a NULL-terminated string.
+ cmdlineLen++
+ }
+ return kexecFileLoad(kernelFd, initrdFd, cmdlineLen, cmdline, flags)
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
index 8932e34..bfef09a 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go
@@ -21,8 +21,8 @@ package unix
//sys Lchown(path string, uid int, gid int) (err error)
//sys Listen(s int, n int) (err error)
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Seek(fd int, offset int64, whence int) (off int64, err error) = SYS_LSEEK
@@ -37,18 +37,13 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//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 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)
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (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 7821c25..ab30250 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go
@@ -25,23 +25,18 @@ func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr,
//sysnb Getuid() (uid int)
//sys Lchown(path string, uid int, gid int) (err error)
//sys Listen(s int, n int) (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//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 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
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
index c5053a0..eac1cf1 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go
@@ -27,23 +27,18 @@ import (
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error) = SYS_LSTAT64
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//sys Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) = SYS__NEWSELECT
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) = SYS_SENDFILE64
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
-//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 int, err error)
//sys Stat(path string, stat *Stat_t) (err error) = SYS_STAT64
//sys Truncate(path string, length int64) (err error) = SYS_TRUNCATE64
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
index 25786c4..4df5661 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go
@@ -26,26 +26,21 @@ package unix
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//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) = SYS__NEWSELECT
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//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)
//sys Statfs(path string, buf *Statfs_t) (err error)
//sys Truncate(path string, length int64) (err error)
//sys Ustat(dev int, ubuf *Ustat_t) (err error)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
index 6f9f710..5f4243d 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go
@@ -22,8 +22,9 @@ import "unsafe"
//sysnb Getrlimit(resource int, rlim *Rlimit) (err error)
//sysnb Getuid() (uid int)
//sys Listen(s int, n int) (err error)
-//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 MemfdSecret(flags int) (fd int, err error)
+//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
func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err error) {
@@ -37,11 +38,7 @@ func Select(nfd int, r *FdSet, w *FdSet, e *FdSet, timeout *Timeval) (n int, err
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//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)
@@ -65,7 +62,6 @@ func Ustat(dev int, ubuf *Ustat_t) (err error) {
return ENOSYS
}
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
index 6aa59cb..d0a7d40 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go
@@ -26,19 +26,15 @@ import (
//sys Lchown(path string, uid int, gid int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//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)
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//sysnb Setreuid(ruid int, euid 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)
//sys Statfs(path string, buf *Statfs_t) (err error)
@@ -145,15 +141,6 @@ const (
netSendMMsg = 20
)
-func accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (int, error) {
- args := [3]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))}
- fd, _, err := Syscall(SYS_SOCKETCALL, netAccept, uintptr(unsafe.Pointer(&args)), 0)
- if err != 0 {
- return 0, err
- }
- return int(fd), nil
-}
-
func accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (int, error) {
args := [4]uintptr{uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen)), uintptr(flags)}
fd, _, err := Syscall(SYS_SOCKETCALL, netAccept4, uintptr(unsafe.Pointer(&args)), 0)
diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
index bbe8d17..f5c793b 100644
--- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go
@@ -23,26 +23,21 @@ package unix
//sys Listen(s int, n int) (err error)
//sys Lstat(path string, stat *Stat_t) (err error)
//sys Pause() (err error)
-//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 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 Renameat(olddirfd int, oldpath string, newdirfd int, newpath string) (err error)
//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)
//sys sendfile(outfd int, infd int, offset *int64, count int) (written int, err error)
//sys setfsgid(gid int) (prev int, err error)
//sys setfsuid(uid int) (prev int, err error)
-//sysnb Setregid(rgid int, egid int) (err error)
-//sysnb Setresgid(rgid int, egid int, sgid int) (err error)
-//sysnb Setresuid(ruid int, euid int, suid int) (err error)
//sysnb Setrlimit(resource int, rlim *Rlimit) (err error)
-//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)
//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)
-//sys accept(s int, rsa *RawSockaddrAny, addrlen *_Socklen) (fd int, err error)
//sys accept4(s int, rsa *RawSockaddrAny, addrlen *_Socklen, flags int) (fd int, err error)
//sys bind(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
//sys connect(s int, addr unsafe.Pointer, addrlen _Socklen) (err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_netbsd.go b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
index 696fed4..35a3ad7 100644
--- a/vendor/golang.org/x/sys/unix/syscall_netbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_netbsd.go
@@ -110,6 +110,20 @@ func direntNamlen(buf []byte) (uint64, bool) {
return readInt(buf, unsafe.Offsetof(Dirent{}.Namlen), unsafe.Sizeof(Dirent{}.Namlen))
}
+func SysctlUvmexp(name string) (*Uvmexp, error) {
+ mib, err := sysctlmib(name)
+ if err != nil {
+ return nil, err
+ }
+
+ n := uintptr(SizeofUvmexp)
+ var u Uvmexp
+ if err := sysctl(mib, (*byte)(unsafe.Pointer(&u)), &n, nil, 0); err != nil {
+ return nil, err
+ }
+ return &u, nil
+}
+
func Pipe(p []int) (err error) {
return Pipe2(p, 0)
}
@@ -163,11 +177,6 @@ func sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
return -1, ENOSYS
}
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
@@ -250,6 +259,7 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
+//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
@@ -313,8 +323,8 @@ func Statvfs(path string, buf *Statvfs_t) (err error) {
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys pread(fd int, p []byte, offset int64) (n int, err error)
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
index 11b1d41..9b67b90 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go
@@ -81,6 +81,7 @@ func Pipe(p []int) (err error) {
}
//sysnb pipe2(p *[2]_C_int, flags int) (err error)
+
func Pipe2(p []int, flags int) error {
if len(p) != 2 {
return EINVAL
@@ -95,6 +96,7 @@ func Pipe2(p []int, flags int) error {
}
//sys Getdents(fd int, buf []byte) (n int, err error)
+
func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
n, err = Getdents(fd, buf)
if err != nil || basep == nil {
@@ -149,11 +151,6 @@ func Getfsstat(buf []Statfs_t, flags int) (n int, err error) {
return
}
-func setattrlistTimes(path string, times []Timespec, flags int) error {
- // used on Darwin for UtimesNano
- return ENOSYS
-}
-
//sys ioctl(fd int, req uint, arg uintptr) (err error)
//sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL
@@ -223,6 +220,7 @@ func Uname(uname *Utsname) error {
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
+//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Dup(fd int) (nfd int, err error)
//sys Dup2(from int, to int) (err error)
@@ -274,8 +272,8 @@ func Uname(uname *Utsname) error {
//sys Open(path string, mode int, perm uint32) (fd int, err error)
//sys Openat(dirfd int, path string, mode int, perm uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys pread(fd int, p []byte, offset int64) (n int, err error)
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Readlinkat(dirfd int, path string, buf []byte) (n int, err error)
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
new file mode 100644
index 0000000..04aa43f
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go
@@ -0,0 +1,27 @@
+// Copyright 2022 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.
+
+//go:build openbsd
+// +build openbsd
+
+package unix
+
+import _ "unsafe"
+
+// Implemented in the runtime package (runtime/sys_openbsd3.go)
+func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno)
+func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno)
+
+//go:linkname syscall_syscall syscall.syscall
+//go:linkname syscall_syscall6 syscall.syscall6
+//go:linkname syscall_syscall10 syscall.syscall10
+//go:linkname syscall_rawSyscall syscall.rawSyscall
+//go:linkname syscall_rawSyscall6 syscall.rawSyscall6
+
+func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) {
+ return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0)
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
index 30f2853..1378489 100644
--- a/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go
@@ -26,6 +26,10 @@ func (msghdr *Msghdr) SetControllen(length int) {
msghdr.Controllen = uint32(length)
}
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
func (cmsg *Cmsghdr) SetLen(length int) {
cmsg.Len = uint32(length)
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
new file mode 100644
index 0000000..c279613
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go
@@ -0,0 +1,42 @@
+// Copyright 2019 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.
+
+//go:build ppc64 && openbsd
+// +build ppc64,openbsd
+
+package unix
+
+func setTimespec(sec, nsec int64) Timespec {
+ return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+ return Timeval{Sec: sec, Usec: usec}
+}
+
+func SetKevent(k *Kevent_t, fd, mode, flags int) {
+ k.Ident = uint64(fd)
+ k.Filter = int16(mode)
+ k.Flags = uint16(flags)
+}
+
+func (iov *Iovec) SetLen(length int) {
+ iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+ msghdr.Controllen = uint32(length)
+}
+
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+ cmsg.Len = uint32(length)
+}
+
+// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
+// of openbsd/ppc64 the syscall is called sysctl instead of __sysctl.
+const SYS___SYSCTL = SYS_SYSCTL
diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
new file mode 100644
index 0000000..23199a7
--- /dev/null
+++ b/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go
@@ -0,0 +1,42 @@
+// Copyright 2019 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.
+
+//go:build riscv64 && openbsd
+// +build riscv64,openbsd
+
+package unix
+
+func setTimespec(sec, nsec int64) Timespec {
+ return Timespec{Sec: sec, Nsec: nsec}
+}
+
+func setTimeval(sec, usec int64) Timeval {
+ return Timeval{Sec: sec, Usec: usec}
+}
+
+func SetKevent(k *Kevent_t, fd, mode, flags int) {
+ k.Ident = uint64(fd)
+ k.Filter = int16(mode)
+ k.Flags = uint16(flags)
+}
+
+func (iov *Iovec) SetLen(length int) {
+ iov.Len = uint64(length)
+}
+
+func (msghdr *Msghdr) SetControllen(length int) {
+ msghdr.Controllen = uint32(length)
+}
+
+func (msghdr *Msghdr) SetIovlen(length int) {
+ msghdr.Iovlen = uint32(length)
+}
+
+func (cmsg *Cmsghdr) SetLen(length int) {
+ cmsg.Len = uint32(length)
+}
+
+// SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions
+// of openbsd/riscv64 the syscall is called sysctl instead of __sysctl.
+const SYS___SYSCTL = SYS_SYSCTL
diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go
index 5c81392..07ac561 100644
--- a/vendor/golang.org/x/sys/unix/syscall_solaris.go
+++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go
@@ -451,77 +451,59 @@ func Accept(fd int) (nfd int, sa Sockaddr, err error) {
//sys recvmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_recvmsg
-func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
+func recvmsgRaw(fd int, iov []Iovec, oob []byte, flags int, rsa *RawSockaddrAny) (n, oobn int, recvflags int, err error) {
var msg Msghdr
- var rsa RawSockaddrAny
- msg.Name = (*byte)(unsafe.Pointer(&rsa))
+ msg.Name = (*byte)(unsafe.Pointer(rsa))
msg.Namelen = uint32(SizeofSockaddrAny)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*int8)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy int8
+ var dummy byte
if len(oob) > 0 {
// receive at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ if emptyIovecs(iov) {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
msg.Accrightslen = int32(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = recvmsg(fd, &msg, flags); n == -1 {
return
}
oobn = int(msg.Accrightslen)
- // source address is only specified if the socket is unconnected
- if rsa.Addr.Family != AF_UNSPEC {
- from, err = anyToSockaddr(fd, &rsa)
- }
- return
-}
-
-func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
- _, err = SendmsgN(fd, p, oob, to, flags)
return
}
//sys sendmsg(s int, msg *Msghdr, flags int) (n int, err error) = libsocket.__xnet_sendmsg
-func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
- var ptr unsafe.Pointer
- var salen _Socklen
- if to != nil {
- ptr, salen, err = to.sockaddr()
- if err != nil {
- return 0, err
- }
- }
+func sendmsgN(fd int, iov []Iovec, oob []byte, ptr unsafe.Pointer, salen _Socklen, flags int) (n int, err error) {
var msg Msghdr
msg.Name = (*byte)(unsafe.Pointer(ptr))
msg.Namelen = uint32(salen)
- var iov Iovec
- if len(p) > 0 {
- iov.Base = (*int8)(unsafe.Pointer(&p[0]))
- iov.SetLen(len(p))
- }
- var dummy int8
+ var dummy byte
+ var empty bool
if len(oob) > 0 {
// send at least one normal byte
- if len(p) == 0 {
- iov.Base = &dummy
- iov.SetLen(1)
+ empty = emptyIovecs(iov)
+ if empty {
+ var iova [1]Iovec
+ iova[0].Base = &dummy
+ iova[0].SetLen(1)
+ iov = iova[:]
}
msg.Accrightslen = int32(len(oob))
}
- msg.Iov = &iov
- msg.Iovlen = 1
+ if len(iov) > 0 {
+ msg.Iov = &iov[0]
+ msg.SetIovlen(len(iov))
+ }
if n, err = sendmsg(fd, &msg, flags); err != nil {
return 0, err
}
- if len(oob) > 0 && len(p) == 0 {
+ if len(oob) > 0 && empty {
n = 0
}
return n, nil
@@ -608,6 +590,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Chmod(path string, mode uint32) (err error)
//sys Chown(path string, uid int, gid int) (err error)
//sys Chroot(path string) (err error)
+//sys ClockGettime(clockid int32, time *Timespec) (err error)
//sys Close(fd int) (err error)
//sys Creat(path string, mode uint32) (fd int, err error)
//sys Dup(fd int) (nfd int, err error)
@@ -636,6 +619,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Getpriority(which int, who int) (n int, err error)
//sysnb Getrlimit(which int, lim *Rlimit) (err error)
//sysnb Getrusage(who int, rusage *Rusage) (err error)
+//sysnb Getsid(pid int) (sid int, err error)
//sysnb Gettimeofday(tv *Timeval) (err error)
//sysnb Getuid() (uid int)
//sys Kill(pid int, signum syscall.Signal) (err error)
@@ -661,8 +645,8 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
//sys Openat(dirfd int, path string, flags int, mode uint32) (fd int, err error)
//sys Pathconf(path string, name int) (val int, err error)
//sys Pause() (err error)
-//sys Pread(fd int, p []byte, offset int64) (n int, err error)
-//sys Pwrite(fd int, p []byte, offset int64) (n int, err error)
+//sys pread(fd int, p []byte, offset int64) (n int, err error)
+//sys pwrite(fd int, p []byte, offset int64) (n int, err error)
//sys read(fd int, p []byte) (n int, err error)
//sys Readlink(path string, buf []byte) (n int, err error)
//sys Rename(from string, to string) (err error)
@@ -755,8 +739,20 @@ type fileObjCookie struct {
type EventPort struct {
port int
mu sync.Mutex
- fds map[uintptr]interface{}
+ fds map[uintptr]*fileObjCookie
paths map[string]*fileObjCookie
+ // The user cookie presents an interesting challenge from a memory management perspective.
+ // There are two paths by which we can discover that it is no longer in use:
+ // 1. The user calls port_dissociate before any events fire
+ // 2. An event fires and we return it to the user
+ // The tricky situation is if the event has fired in the kernel but
+ // the user hasn't requested/received it yet.
+ // If the user wants to port_dissociate before the event has been processed,
+ // we should handle things gracefully. To do so, we need to keep an extra
+ // reference to the cookie around until the event is processed
+ // thus the otherwise seemingly extraneous "cookies" map
+ // The key of this map is a pointer to the corresponding fCookie
+ cookies map[*fileObjCookie]struct{}
}
// PortEvent is an abstraction of the port_event C struct.
@@ -780,9 +776,10 @@ func NewEventPort() (*EventPort, error) {
return nil, err
}
e := &EventPort{
- port: port,
- fds: make(map[uintptr]interface{}),
- paths: make(map[string]*fileObjCookie),
+ port: port,
+ fds: make(map[uintptr]*fileObjCookie),
+ paths: make(map[string]*fileObjCookie),
+ cookies: make(map[*fileObjCookie]struct{}),
}
return e, nil
}
@@ -797,9 +794,14 @@ func NewEventPort() (*EventPort, error) {
func (e *EventPort) Close() error {
e.mu.Lock()
defer e.mu.Unlock()
+ err := Close(e.port)
+ if err != nil {
+ return err
+ }
e.fds = nil
e.paths = nil
- return Close(e.port)
+ e.cookies = nil
+ return nil
}
// PathIsWatched checks to see if path is associated with this EventPort.
@@ -826,16 +828,16 @@ func (e *EventPort) AssociatePath(path string, stat os.FileInfo, events int, coo
if _, found := e.paths[path]; found {
return fmt.Errorf("%v is already associated with this Event Port", path)
}
- fobj, err := createFileObj(path, stat)
+ fCookie, err := createFileObjCookie(path, stat, cookie)
if err != nil {
return err
}
- fCookie := &fileObjCookie{fobj, cookie}
- _, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fobj)), events, (*byte)(unsafe.Pointer(&fCookie.cookie)))
+ _, err = port_associate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(fCookie.fobj)), events, (*byte)(unsafe.Pointer(fCookie)))
if err != nil {
return err
}
e.paths[path] = fCookie
+ e.cookies[fCookie] = struct{}{}
return nil
}
@@ -848,11 +850,19 @@ func (e *EventPort) DissociatePath(path string) error {
return fmt.Errorf("%v is not associated with this Event Port", path)
}
_, err := port_dissociate(e.port, PORT_SOURCE_FILE, uintptr(unsafe.Pointer(f.fobj)))
- if err != nil {
+ // If the path is no longer associated with this event port (ENOENT)
+ // we should delete it from our map. We can still return ENOENT to the caller.
+ // But we need to save the cookie
+ if err != nil && err != ENOENT {
return err
}
+ if err == nil {
+ // dissociate was successful, safe to delete the cookie
+ fCookie := e.paths[path]
+ delete(e.cookies, fCookie)
+ }
delete(e.paths, path)
- return nil
+ return err
}
// AssociateFd wraps calls to port_associate(3c) on file descriptors.
@@ -862,12 +872,16 @@ func (e *EventPort) AssociateFd(fd uintptr, events int, cookie interface{}) erro
if _, found := e.fds[fd]; found {
return fmt.Errorf("%v is already associated with this Event Port", fd)
}
- pcookie := &cookie
- _, err := port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(pcookie)))
+ fCookie, err := createFileObjCookie("", nil, cookie)
if err != nil {
return err
}
- e.fds[fd] = pcookie
+ _, err = port_associate(e.port, PORT_SOURCE_FD, fd, events, (*byte)(unsafe.Pointer(fCookie)))
+ if err != nil {
+ return err
+ }
+ e.fds[fd] = fCookie
+ e.cookies[fCookie] = struct{}{}
return nil
}
@@ -880,28 +894,37 @@ func (e *EventPort) DissociateFd(fd uintptr) error {
return fmt.Errorf("%v is not associated with this Event Port", fd)
}
_, err := port_dissociate(e.port, PORT_SOURCE_FD, fd)
- if err != nil {
+ if err != nil && err != ENOENT {
return err
}
+ if err == nil {
+ // dissociate was successful, safe to delete the cookie
+ fCookie := e.fds[fd]
+ delete(e.cookies, fCookie)
+ }
delete(e.fds, fd)
- return nil
+ return err
}
-func createFileObj(name string, stat os.FileInfo) (*fileObj, error) {
- fobj := new(fileObj)
- bs, err := ByteSliceFromString(name)
- if err != nil {
- return nil, err
+func createFileObjCookie(name string, stat os.FileInfo, cookie interface{}) (*fileObjCookie, error) {
+ fCookie := new(fileObjCookie)
+ fCookie.cookie = cookie
+ if name != "" && stat != nil {
+ fCookie.fobj = new(fileObj)
+ bs, err := ByteSliceFromString(name)
+ if err != nil {
+ return nil, err
+ }
+ fCookie.fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
+ s := stat.Sys().(*syscall.Stat_t)
+ fCookie.fobj.Atim.Sec = s.Atim.Sec
+ fCookie.fobj.Atim.Nsec = s.Atim.Nsec
+ fCookie.fobj.Mtim.Sec = s.Mtim.Sec
+ fCookie.fobj.Mtim.Nsec = s.Mtim.Nsec
+ fCookie.fobj.Ctim.Sec = s.Ctim.Sec
+ fCookie.fobj.Ctim.Nsec = s.Ctim.Nsec
}
- fobj.Name = (*int8)(unsafe.Pointer(&bs[0]))
- s := stat.Sys().(*syscall.Stat_t)
- fobj.Atim.Sec = s.Atim.Sec
- fobj.Atim.Nsec = s.Atim.Nsec
- fobj.Mtim.Sec = s.Mtim.Sec
- fobj.Mtim.Nsec = s.Mtim.Nsec
- fobj.Ctim.Sec = s.Ctim.Sec
- fobj.Ctim.Nsec = s.Ctim.Nsec
- return fobj, nil
+ return fCookie, nil
}
// GetOne wraps port_get(3c) and returns a single PortEvent.
@@ -912,26 +935,54 @@ func (e *EventPort) GetOne(t *Timespec) (*PortEvent, error) {
return nil, err
}
p := new(PortEvent)
- p.Events = pe.Events
- p.Source = pe.Source
e.mu.Lock()
defer e.mu.Unlock()
- switch pe.Source {
- case PORT_SOURCE_FD:
- p.Fd = uintptr(pe.Object)
- cookie := (*interface{})(unsafe.Pointer(pe.User))
- p.Cookie = *cookie
- delete(e.fds, p.Fd)
- case PORT_SOURCE_FILE:
- p.fobj = (*fileObj)(unsafe.Pointer(uintptr(pe.Object)))
- p.Path = BytePtrToString((*byte)(unsafe.Pointer(p.fobj.Name)))
- cookie := (*interface{})(unsafe.Pointer(pe.User))
- p.Cookie = *cookie
- delete(e.paths, p.Path)
+ err = e.peIntToExt(pe, p)
+ if err != nil {
+ return nil, err
}
return p, nil
}
+// peIntToExt converts a cgo portEvent struct into the friendlier PortEvent
+// NOTE: Always call this function while holding the e.mu mutex
+func (e *EventPort) peIntToExt(peInt *portEvent, peExt *PortEvent) error {
+ if e.cookies == nil {
+ return fmt.Errorf("this EventPort is already closed")
+ }
+ peExt.Events = peInt.Events
+ peExt.Source = peInt.Source
+ fCookie := (*fileObjCookie)(unsafe.Pointer(peInt.User))
+ _, found := e.cookies[fCookie]
+
+ if !found {
+ panic("unexpected event port address; may be due to kernel bug; see https://go.dev/issue/54254")
+ }
+ peExt.Cookie = fCookie.cookie
+ delete(e.cookies, fCookie)
+
+ switch peInt.Source {
+ case PORT_SOURCE_FD:
+ peExt.Fd = uintptr(peInt.Object)
+ // Only remove the fds entry if it exists and this cookie matches
+ if fobj, ok := e.fds[peExt.Fd]; ok {
+ if fobj == fCookie {
+ delete(e.fds, peExt.Fd)
+ }
+ }
+ case PORT_SOURCE_FILE:
+ peExt.fobj = fCookie.fobj
+ peExt.Path = BytePtrToString((*byte)(unsafe.Pointer(peExt.fobj.Name)))
+ // Only remove the paths entry if it exists and this cookie matches
+ if fobj, ok := e.paths[peExt.Path]; ok {
+ if fobj == fCookie {
+ delete(e.paths, peExt.Path)
+ }
+ }
+ }
+ return nil
+}
+
// Pending wraps port_getn(3c) and returns how many events are pending.
func (e *EventPort) Pending() (int, error) {
var n uint32 = 0
@@ -953,7 +1004,7 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error)
got := uint32(min)
max := uint32(len(s))
var err error
- ps := make([]portEvent, max, max)
+ ps := make([]portEvent, max)
_, err = port_getn(e.port, &ps[0], max, &got, timeout)
// got will be trustworthy with ETIME, but not any other error.
if err != nil && err != ETIME {
@@ -961,22 +1012,122 @@ func (e *EventPort) Get(s []PortEvent, min int, timeout *Timespec) (int, error)
}
e.mu.Lock()
defer e.mu.Unlock()
+ valid := 0
for i := 0; i < int(got); i++ {
- s[i].Events = ps[i].Events
- s[i].Source = ps[i].Source
- switch ps[i].Source {
- case PORT_SOURCE_FD:
- s[i].Fd = uintptr(ps[i].Object)
- cookie := (*interface{})(unsafe.Pointer(ps[i].User))
- s[i].Cookie = *cookie
- delete(e.fds, s[i].Fd)
- case PORT_SOURCE_FILE:
- s[i].fobj = (*fileObj)(unsafe.Pointer(uintptr(ps[i].Object)))
- s[i].Path = BytePtrToString((*byte)(unsafe.Pointer(s[i].fobj.Name)))
- cookie := (*interface{})(unsafe.Pointer(ps[i].User))
- s[i].Cookie = *cookie
- delete(e.paths, s[i].Path)
+ err2 := e.peIntToExt(&ps[i], &s[i])
+ if err2 != nil {
+ if valid == 0 && err == nil {
+ // If err2 is the only error and there are no valid events
+ // to return, return it to the caller.
+ err = err2
+ }
+ break
+ }
+ valid = i + 1
+ }
+ return valid, err
+}
+
+//sys putmsg(fd int, clptr *strbuf, dataptr *strbuf, flags int) (err error)
+
+func Putmsg(fd int, cl []byte, data []byte, flags int) (err error) {
+ var clp, datap *strbuf
+ if len(cl) > 0 {
+ clp = &strbuf{
+ Len: int32(len(cl)),
+ Buf: (*int8)(unsafe.Pointer(&cl[0])),
}
}
- return int(got), err
+ if len(data) > 0 {
+ datap = &strbuf{
+ Len: int32(len(data)),
+ Buf: (*int8)(unsafe.Pointer(&data[0])),
+ }
+ }
+ return putmsg(fd, clp, datap, flags)
+}
+
+//sys getmsg(fd int, clptr *strbuf, dataptr *strbuf, flags *int) (err error)
+
+func Getmsg(fd int, cl []byte, data []byte) (retCl []byte, retData []byte, flags int, err error) {
+ var clp, datap *strbuf
+ if len(cl) > 0 {
+ clp = &strbuf{
+ Maxlen: int32(len(cl)),
+ Buf: (*int8)(unsafe.Pointer(&cl[0])),
+ }
+ }
+ if len(data) > 0 {
+ datap = &strbuf{
+ Maxlen: int32(len(data)),
+ Buf: (*int8)(unsafe.Pointer(&data[0])),
+ }
+ }
+
+ if err = getmsg(fd, clp, datap, &flags); err != nil {
+ return nil, nil, 0, err
+ }
+
+ if len(cl) > 0 {
+ retCl = cl[:clp.Len]
+ }
+ if len(data) > 0 {
+ retData = data[:datap.Len]
+ }
+ return retCl, retData, flags, nil
+}
+
+func IoctlSetIntRetInt(fd int, req uint, arg int) (int, error) {
+ return ioctlRet(fd, req, uintptr(arg))
+}
+
+func IoctlSetString(fd int, req uint, val string) error {
+ bs := make([]byte, len(val)+1)
+ copy(bs[:len(bs)-1], val)
+ err := ioctl(fd, req, uintptr(unsafe.Pointer(&bs[0])))
+ runtime.KeepAlive(&bs[0])
+ return err
+}
+
+// Lifreq Helpers
+
+func (l *Lifreq) SetName(name string) error {
+ if len(name) >= len(l.Name) {
+ return fmt.Errorf("name cannot be more than %d characters", len(l.Name)-1)
+ }
+ for i := range name {
+ l.Name[i] = int8(name[i])
+ }
+ return nil
+}
+
+func (l *Lifreq) SetLifruInt(d int) {
+ *(*int)(unsafe.Pointer(&l.Lifru[0])) = d
+}
+
+func (l *Lifreq) GetLifruInt() int {
+ return *(*int)(unsafe.Pointer(&l.Lifru[0]))
+}
+
+func (l *Lifreq) SetLifruUint(d uint) {
+ *(*uint)(unsafe.Pointer(&l.Lifru[0])) = d
+}
+
+func (l *Lifreq) GetLifruUint() uint {
+ return *(*uint)(unsafe.Pointer(&l.Lifru[0]))
+}
+
+func IoctlLifreq(fd int, req uint, l *Lifreq) error {
+ return ioctl(fd, req, uintptr(unsafe.Pointer(l)))
+}
+
+// Strioctl Helpers
+
+func (s *Strioctl) SetInt(i int) {
+ s.Len = int32(unsafe.Sizeof(i))
+ s.Dp = (*int8)(unsafe.Pointer(&i))
+}
+
+func IoctlSetStrioctlRetInt(fd int, req uint, s *Strioctl) (int, error) {
+ return ioctlRet(fd, req, uintptr(unsafe.Pointer(s)))
}
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix.go b/vendor/golang.org/x/sys/unix/syscall_unix.go
index cf296a2..a386f88 100644
--- a/vendor/golang.org/x/sys/unix/syscall_unix.go
+++ b/vendor/golang.org/x/sys/unix/syscall_unix.go
@@ -13,8 +13,6 @@ import (
"sync"
"syscall"
"unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
)
var (
@@ -117,11 +115,7 @@ func (m *mmapper) Mmap(fd int, offset int64, length int, prot int, flags int) (d
}
// Use unsafe to convert addr into a []byte.
- var b []byte
- hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
- hdr.Data = unsafe.Pointer(addr)
- hdr.Cap = length
- hdr.Len = length
+ b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), length)
// Register mapping in m and return it.
p := &b[cap(b)-1]
@@ -177,6 +171,30 @@ func Write(fd int, p []byte) (n int, err error) {
return
}
+func Pread(fd int, p []byte, offset int64) (n int, err error) {
+ n, err = pread(fd, p, offset)
+ if raceenabled {
+ if n > 0 {
+ raceWriteRange(unsafe.Pointer(&p[0]), n)
+ }
+ if err == nil {
+ raceAcquire(unsafe.Pointer(&ioSync))
+ }
+ }
+ return
+}
+
+func Pwrite(fd int, p []byte, offset int64) (n int, err error) {
+ if raceenabled {
+ raceReleaseMerge(unsafe.Pointer(&ioSync))
+ }
+ n, err = pwrite(fd, p, offset)
+ if raceenabled && n > 0 {
+ raceReadRange(unsafe.Pointer(&p[0]), n)
+ }
+ return
+}
+
// For testing: clients can set this flag to force
// creation of IPv6 sockets to return EAFNOSUPPORT.
var SocketDisableIPv6 bool
@@ -313,16 +331,142 @@ func Recvfrom(fd int, p []byte, flags int) (n int, from Sockaddr, err error) {
return
}
+// Recvmsg receives a message from a socket using the recvmsg system call. The
+// received non-control data will be written to p, and any "out of band"
+// control data will be written to oob. The flags are passed to recvmsg.
+//
+// The results are:
+// - n is the number of non-control data bytes read into p
+// - oobn is the number of control data bytes read into oob; this may be interpreted using [ParseSocketControlMessage]
+// - recvflags is flags returned by recvmsg
+// - from is the address of the sender
+//
+// If the underlying socket type is not SOCK_DGRAM, a received message
+// containing oob data and a single '\0' of non-control data is treated as if
+// the message contained only control data, i.e. n will be zero on return.
+func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
+ var iov [1]Iovec
+ if len(p) > 0 {
+ iov[0].Base = &p[0]
+ iov[0].SetLen(len(p))
+ }
+ var rsa RawSockaddrAny
+ n, oobn, recvflags, err = recvmsgRaw(fd, iov[:], oob, flags, &rsa)
+ // source address is only specified if the socket is unconnected
+ if rsa.Addr.Family != AF_UNSPEC {
+ from, err = anyToSockaddr(fd, &rsa)
+ }
+ return
+}
+
+// RecvmsgBuffers receives a message from a socket using the recvmsg system
+// call. This function is equivalent to Recvmsg, but non-control data read is
+// scattered into the buffers slices.
+func RecvmsgBuffers(fd int, buffers [][]byte, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) {
+ iov := make([]Iovec, len(buffers))
+ for i := range buffers {
+ if len(buffers[i]) > 0 {
+ iov[i].Base = &buffers[i][0]
+ iov[i].SetLen(len(buffers[i]))
+ } else {
+ iov[i].Base = (*byte)(unsafe.Pointer(&_zero))
+ }
+ }
+ var rsa RawSockaddrAny
+ n, oobn, recvflags, err = recvmsgRaw(fd, iov, oob, flags, &rsa)
+ if err == nil && rsa.Addr.Family != AF_UNSPEC {
+ from, err = anyToSockaddr(fd, &rsa)
+ }
+ return
+}
+
+// Sendmsg sends a message on a socket to an address using the sendmsg system
+// call. This function is equivalent to SendmsgN, but does not return the
+// number of bytes actually sent.
+func Sendmsg(fd int, p, oob []byte, to Sockaddr, flags int) (err error) {
+ _, err = SendmsgN(fd, p, oob, to, flags)
+ return
+}
+
+// SendmsgN sends a message on a socket to an address using the sendmsg system
+// call. p contains the non-control data to send, and oob contains the "out of
+// band" control data. The flags are passed to sendmsg. The number of
+// non-control bytes actually written to the socket is returned.
+//
+// Some socket types do not support sending control data without accompanying
+// non-control data. If p is empty, and oob contains control data, and the
+// underlying socket type is not SOCK_DGRAM, p will be treated as containing a
+// single '\0' and the return value will indicate zero bytes sent.
+//
+// The Go function Recvmsg, if called with an empty p and a non-empty oob,
+// will read and ignore this additional '\0'. If the message is received by
+// code that does not use Recvmsg, or that does not use Go at all, that code
+// will need to be written to expect and ignore the additional '\0'.
+//
+// If you need to send non-empty oob with p actually empty, and if the
+// underlying socket type supports it, you can do so via a raw system call as
+// follows:
+//
+// msg := &unix.Msghdr{
+// Control: &oob[0],
+// }
+// msg.SetControllen(len(oob))
+// n, _, errno := unix.Syscall(unix.SYS_SENDMSG, uintptr(fd), uintptr(unsafe.Pointer(msg)), flags)
+func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) {
+ var iov [1]Iovec
+ if len(p) > 0 {
+ iov[0].Base = &p[0]
+ iov[0].SetLen(len(p))
+ }
+ var ptr unsafe.Pointer
+ var salen _Socklen
+ if to != nil {
+ ptr, salen, err = to.sockaddr()
+ if err != nil {
+ return 0, err
+ }
+ }
+ return sendmsgN(fd, iov[:], oob, ptr, salen, flags)
+}
+
+// SendmsgBuffers sends a message on a socket to an address using the sendmsg
+// system call. This function is equivalent to SendmsgN, but the non-control
+// data is gathered from buffers.
+func SendmsgBuffers(fd int, buffers [][]byte, oob []byte, to Sockaddr, flags int) (n int, err error) {
+ iov := make([]Iovec, len(buffers))
+ for i := range buffers {
+ if len(buffers[i]) > 0 {
+ iov[i].Base = &buffers[i][0]
+ iov[i].SetLen(len(buffers[i]))
+ } else {
+ iov[i].Base = (*byte)(unsafe.Pointer(&_zero))
+ }
+ }
+ var ptr unsafe.Pointer
+ var salen _Socklen
+ if to != nil {
+ ptr, salen, err = to.sockaddr()
+ if err != nil {
+ return 0, err
+ }
+ }
+ return sendmsgN(fd, iov, oob, ptr, salen, flags)
+}
+
func Send(s int, buf []byte, flags int) (err error) {
return sendto(s, buf, flags, nil, 0)
}
func Sendto(fd int, p []byte, flags int, to Sockaddr) (err error) {
- ptr, n, err := to.sockaddr()
- if err != nil {
- return err
+ var ptr unsafe.Pointer
+ var salen _Socklen
+ if to != nil {
+ ptr, salen, err = to.sockaddr()
+ if err != nil {
+ return err
+ }
}
- return sendto(fd, p, flags, ptr, n)
+ return sendto(fd, p, flags, ptr, salen)
}
func SetsockoptByte(fd, level, opt int, value byte) (err error) {
@@ -433,3 +577,13 @@ func Lutimes(path string, tv []Timeval) error {
}
return UtimesNanoAt(AT_FDCWD, path, ts, AT_SYMLINK_NOFOLLOW)
}
+
+// emptyIovec reports whether there are no bytes in the slice of Iovec.
+func emptyIovecs(iov []Iovec) bool {
+ for i := range iov {
+ if iov[i].Len > 0 {
+ return false
+ }
+ }
+ return true
+}
diff --git a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
index 5898e9a..b6919ca 100644
--- a/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
+++ b/vendor/golang.org/x/sys/unix/syscall_unix_gc.go
@@ -2,11 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-//go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64
-// +build darwin dragonfly freebsd linux netbsd openbsd solaris
+//go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc
+// +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris
// +build gc
-// +build !ppc64le
-// +build !ppc64
package unix
diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
index f8616f4..68b2f3e 100644
--- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
+++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go
@@ -9,8 +9,10 @@ package unix
import (
"bytes"
+ "fmt"
"runtime"
"sort"
+ "strings"
"sync"
"syscall"
"unsafe"
@@ -55,7 +57,13 @@ func (d *Dirent) NameString() string {
if d == nil {
return ""
}
- return string(d.Name[:d.Namlen])
+ s := string(d.Name[:])
+ idx := strings.IndexByte(s, 0)
+ if idx == -1 {
+ return s
+ } else {
+ return s[:idx]
+ }
}
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
@@ -1230,6 +1238,14 @@ func Readdir(dir uintptr) (*Dirent, error) {
return &ent, err
}
+func readdir_r(dirp uintptr, entry *direntLE, result **direntLE) (err error) {
+ r0, _, e1 := syscall_syscall(SYS___READDIR_R_A, dirp, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result)))
+ if int64(r0) == -1 {
+ err = errnoErr(Errno(e1))
+ }
+ return
+}
+
func Closedir(dir uintptr) error {
_, _, e := syscall_syscall(SYS_CLOSEDIR, dir, 0, 0)
if e != 0 {
@@ -1821,3 +1837,158 @@ func Unmount(name string, mtm int) (err error) {
}
return err
}
+
+func fdToPath(dirfd int) (path string, err error) {
+ var buffer [1024]byte
+ // w_ctrl()
+ ret := runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_W_IOCTL<<4,
+ []uintptr{uintptr(dirfd), 17, 1024, uintptr(unsafe.Pointer(&buffer[0]))})
+ if ret == 0 {
+ zb := bytes.IndexByte(buffer[:], 0)
+ if zb == -1 {
+ zb = len(buffer)
+ }
+ // __e2a_l()
+ runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___E2A_L<<4,
+ []uintptr{uintptr(unsafe.Pointer(&buffer[0])), uintptr(zb)})
+ return string(buffer[:zb]), nil
+ }
+ // __errno()
+ errno := int(*(*int32)(unsafe.Pointer(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO<<4,
+ []uintptr{}))))
+ // __errno2()
+ errno2 := int(runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS___ERRNO2<<4,
+ []uintptr{}))
+ // strerror_r()
+ ret = runtime.CallLeFuncByPtr(runtime.XplinkLibvec+SYS_STRERROR_R<<4,
+ []uintptr{uintptr(errno), uintptr(unsafe.Pointer(&buffer[0])), 1024})
+ if ret == 0 {
+ zb := bytes.IndexByte(buffer[:], 0)
+ if zb == -1 {
+ zb = len(buffer)
+ }
+ return "", fmt.Errorf("%s (errno2=0x%x)", buffer[:zb], errno2)
+ } else {
+ return "", fmt.Errorf("fdToPath errno %d (errno2=0x%x)", errno, errno2)
+ }
+}
+
+func direntLeToDirentUnix(dirent *direntLE, dir uintptr, path string) (Dirent, error) {
+ var d Dirent
+
+ d.Ino = uint64(dirent.Ino)
+ offset, err := Telldir(dir)
+ if err != nil {
+ return d, err
+ }
+
+ d.Off = int64(offset)
+ s := string(bytes.Split(dirent.Name[:], []byte{0})[0])
+ copy(d.Name[:], s)
+
+ d.Reclen = uint16(24 + len(d.NameString()))
+ var st Stat_t
+ path = path + "/" + s
+ err = Lstat(path, &st)
+ if err != nil {
+ return d, err
+ }
+
+ d.Type = uint8(st.Mode >> 24)
+ return d, err
+}
+
+func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) {
+ // Simulation of Getdirentries port from the Darwin implementation.
+ // COMMENTS FROM DARWIN:
+ // It's not the full required semantics, but should handle the case
+ // of calling Getdirentries or ReadDirent repeatedly.
+ // It won't handle assigning the results of lseek to *basep, or handle
+ // the directory being edited underfoot.
+
+ skip, err := Seek(fd, 0, 1 /* SEEK_CUR */)
+ if err != nil {
+ return 0, err
+ }
+
+ // Get path from fd to avoid unavailable call (fdopendir)
+ path, err := fdToPath(fd)
+ if err != nil {
+ return 0, err
+ }
+ d, err := Opendir(path)
+ if err != nil {
+ return 0, err
+ }
+ defer Closedir(d)
+
+ var cnt int64
+ for {
+ var entryLE direntLE
+ var entrypLE *direntLE
+ e := readdir_r(d, &entryLE, &entrypLE)
+ if e != nil {
+ return n, e
+ }
+ if entrypLE == nil {
+ break
+ }
+ if skip > 0 {
+ skip--
+ cnt++
+ continue
+ }
+
+ // Dirent on zos has a different structure
+ entry, e := direntLeToDirentUnix(&entryLE, d, path)
+ if e != nil {
+ return n, e
+ }
+
+ reclen := int(entry.Reclen)
+ if reclen > len(buf) {
+ // Not enough room. Return for now.
+ // The counter will let us know where we should start up again.
+ // Note: this strategy for suspending in the middle and
+ // restarting is O(n^2) in the length of the directory. Oh well.
+ break
+ }
+
+ // Copy entry into return buffer.
+ s := unsafe.Slice((*byte)(unsafe.Pointer(&entry)), reclen)
+ copy(buf, s)
+
+ buf = buf[reclen:]
+ n += reclen
+ cnt++
+ }
+ // Set the seek offset of the input fd to record
+ // how many files we've already returned.
+ _, err = Seek(fd, cnt, 0 /* SEEK_SET */)
+ if err != nil {
+ return n, err
+ }
+
+ return n, nil
+}
+
+func ReadDirent(fd int, buf []byte) (n int, err error) {
+ var base = (*uintptr)(unsafe.Pointer(new(uint64)))
+ return Getdirentries(fd, buf, base)
+}
+
+func direntIno(buf []byte) (uint64, bool) {
+ return readInt(buf, unsafe.Offsetof(Dirent{}.Ino), unsafe.Sizeof(Dirent{}.Ino))
+}
+
+func direntReclen(buf []byte) (uint64, bool) {
+ return readInt(buf, unsafe.Offsetof(Dirent{}.Reclen), unsafe.Sizeof(Dirent{}.Reclen))
+}
+
+func direntNamlen(buf []byte) (uint64, bool) {
+ reclen, ok := direntReclen(buf)
+ if !ok {
+ return 0, false
+ }
+ return reclen - uint64(unsafe.Offsetof(Dirent{}.Name)), true
+}
diff --git a/vendor/golang.org/x/sys/unix/sysvshm_unix.go b/vendor/golang.org/x/sys/unix/sysvshm_unix.go
index 0bb4c8d..5bb41d1 100644
--- a/vendor/golang.org/x/sys/unix/sysvshm_unix.go
+++ b/vendor/golang.org/x/sys/unix/sysvshm_unix.go
@@ -7,11 +7,7 @@
package unix
-import (
- "unsafe"
-
- "golang.org/x/sys/internal/unsafeheader"
-)
+import "unsafe"
// SysvShmAttach attaches the Sysv shared memory segment associated with the
// shared memory identifier id.
@@ -34,12 +30,7 @@ func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) {
}
// Use unsafe to convert addr into a []byte.
- // TODO: convert to unsafe.Slice once we can assume Go 1.17
- var b []byte
- hdr := (*unsafeheader.Slice)(unsafe.Pointer(&b))
- hdr.Data = unsafe.Pointer(addr)
- hdr.Cap = int(info.Segsz)
- hdr.Len = int(info.Segsz)
+ b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz))
return b, nil
}
diff --git a/vendor/golang.org/x/sys/unix/types_aix.go b/vendor/golang.org/x/sys/unix/types_aix.go
deleted file mode 100644
index bfa2a70..0000000
--- a/vendor/golang.org/x/sys/unix/types_aix.go
+++ /dev/null
@@ -1,238 +0,0 @@
-// 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.
-
-//go:build ignore && aix
-// +build ignore,aix
-
-/*
-Input to cgo -godefs. See also mkerrors.sh and mkall.sh
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-#include
-
-
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
- PathMax = C.PATH_MAX
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-type off64 C.off64_t
-type off C.off_t
-type Mode_t C.mode_t
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-type Timeval32 C.struct_timeval32
-
-type Timex C.struct_timex
-
-type Time_t C.time_t
-
-type Tms C.struct_tms
-
-type Utimbuf C.struct_utimbuf
-
-type Timezone C.struct_timezone
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit64
-
-type Pid_t C.pid_t
-
-type _Gid_t C.gid_t
-
-type dev_t C.dev_t
-
-// Files
-
-type Stat_t C.struct_stat
-
-type StatxTimestamp C.struct_statx_timestamp
-
-type Statx_t C.struct_statx
-
-type Dirent C.struct_dirent
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Cmsghdr C.struct_cmsghdr
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type Linger C.struct_linger
-
-type Msghdr C.struct_msghdr
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
-)
-
-type IfMsgHdr C.struct_if_msghdr
-
-// Misc
-
-type FdSet C.fd_set
-
-type Utsname C.struct_utsname
-
-type Ustat_t C.struct_ustat
-
-type Sigset_t C.sigset_t
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_REMOVEDIR = C.AT_REMOVEDIR
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
-)
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Termio C.struct_termio
-
-type Winsize C.struct_winsize
-
-//poll
-
-type PollFd struct {
- Fd int32
- Events uint16
- Revents uint16
-}
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-//flock_t
-
-type Flock_t C.struct_flock64
-
-// Statfs
-
-type Fsid_t C.struct_fsid_t
-type Fsid64_t C.struct_fsid64_t
-
-type Statfs_t C.struct_statfs
-
-const RNDGETENTCNT = 0x80045200
diff --git a/vendor/golang.org/x/sys/unix/types_darwin.go b/vendor/golang.org/x/sys/unix/types_darwin.go
deleted file mode 100644
index 820e2d6..0000000
--- a/vendor/golang.org/x/sys/unix/types_darwin.go
+++ /dev/null
@@ -1,376 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define __DARWIN_UNIX03 0
-#define KERNEL 1
-#define _DARWIN_USE_64_BIT_INODE
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-#if defined(__x86_64__)
-typedef struct stat64 stat_t;
-typedef struct statfs64 statfs_t;
-#else // __arm__
-typedef struct stat stat_t;
-typedef struct statfs statfs_t;
-#endif
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-type Timeval32 C.struct_timeval32
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit
-
-type _Gid_t C.gid_t
-
-// Files
-
-type Stat_t C.stat_t
-
-type Statfs_t C.statfs_t
-
-type Flock_t C.struct_flock
-
-type Fstore_t C.struct_fstore
-
-type Radvisory_t C.struct_radvisory
-
-type Fbootstraptransfer_t C.struct_fbootstraptransfer
-
-type Log2phys_t C.struct_log2phys
-
-type Fsid C.struct_fsid
-
-type Dirent C.struct_dirent
-
-// File system limits
-
-const (
- PathMax = C.PATH_MAX
-)
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type RawSockaddrCtl C.struct_sockaddr_ctl
-
-type RawSockaddrVM C.struct_sockaddr_vm
-
-type XVSockPCB C.struct_xvsockpcb
-
-type XSocket C.struct_xsocket
-
-type XSocket64 C.struct_xsocket64
-
-type XSockbuf C.struct_xsockbuf
-
-type XVSockPgen C.struct_xvsockpgen
-
-type _Socklen C.socklen_t
-
-type Xucred C.struct_xucred
-
-type Linger C.struct_linger
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPMreqn C.struct_ip_mreqn
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type Msghdr C.struct_msghdr
-
-type Cmsghdr C.struct_cmsghdr
-
-type Inet4Pktinfo C.struct_in_pktinfo
-
-type Inet6Pktinfo C.struct_in6_pktinfo
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofSockaddrCtl = C.sizeof_struct_sockaddr_ctl
- SizeofSockaddrVM = C.sizeof_struct_sockaddr_vm
- SizeofXvsockpcb = C.sizeof_struct_xvsockpcb
- SizeofXSocket = C.sizeof_struct_xsocket
- SizeofXSockbuf = C.sizeof_struct_xsockbuf
- SizeofXVSockPgen = C.sizeof_struct_xvsockpgen
- SizeofXucred = C.sizeof_struct_xucred
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPMreqn = C.sizeof_struct_ip_mreqn
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofInet4Pktinfo = C.sizeof_struct_in_pktinfo
- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Ptrace requests
-
-const (
- PTRACE_TRACEME = C.PT_TRACE_ME
- PTRACE_CONT = C.PT_CONTINUE
- PTRACE_KILL = C.PT_KILL
-)
-
-// Events (kqueue, kevent)
-
-type Kevent_t C.struct_kevent
-
-// Select
-
-type FdSet C.fd_set
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
- SizeofIfData = C.sizeof_struct_if_data
- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
- SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
- SizeofIfmaMsghdr2 = C.sizeof_struct_ifma_msghdr2
- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
- SizeofRtMetrics = C.sizeof_struct_rt_metrics
-)
-
-type IfMsghdr C.struct_if_msghdr
-
-type IfData C.struct_if_data
-
-type IfaMsghdr C.struct_ifa_msghdr
-
-type IfmaMsghdr C.struct_ifma_msghdr
-
-type IfmaMsghdr2 C.struct_ifma_msghdr2
-
-type RtMsghdr C.struct_rt_msghdr
-
-type RtMetrics C.struct_rt_metrics
-
-// Berkeley packet filter
-
-const (
- SizeofBpfVersion = C.sizeof_struct_bpf_version
- SizeofBpfStat = C.sizeof_struct_bpf_stat
- SizeofBpfProgram = C.sizeof_struct_bpf_program
- SizeofBpfInsn = C.sizeof_struct_bpf_insn
- SizeofBpfHdr = C.sizeof_struct_bpf_hdr
-)
-
-type BpfVersion C.struct_bpf_version
-
-type BpfStat C.struct_bpf_stat
-
-type BpfProgram C.struct_bpf_program
-
-type BpfInsn C.struct_bpf_insn
-
-type BpfHdr C.struct_bpf_hdr
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Winsize C.struct_winsize
-
-// fchmodat-like syscalls.
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_REMOVEDIR = C.AT_REMOVEDIR
- AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
-)
-
-// poll
-
-type PollFd C.struct_pollfd
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-// uname
-
-type Utsname C.struct_utsname
-
-// Clockinfo
-
-const SizeofClockinfo = C.sizeof_struct_clockinfo
-
-type Clockinfo C.struct_clockinfo
-
-// ctl_info
-
-type CtlInfo C.struct_ctl_info
-
-// KinfoProc
-
-const SizeofKinfoProc = C.sizeof_struct_kinfo_proc
-
-type Eproc C.struct_eproc
-
-type ExternProc C.struct_extern_proc
-
-type Itimerval C.struct_itimerval
-
-type KinfoProc C.struct_kinfo_proc
-
-type Vmspace C.struct_vmspace
-
-type Pcred C.struct__pcred
-
-type Ucred C.struct__ucred
-
-// shm
-
-type SysvIpcPerm C.struct_ipc_perm
-type SysvShmDesc C.struct_shmid_ds
-
-const (
- IPC_CREAT = C.IPC_CREAT
- IPC_EXCL = C.IPC_EXCL
- IPC_NOWAIT = C.IPC_NOWAIT
- IPC_PRIVATE = C.IPC_PRIVATE
-)
-
-const (
- IPC_RMID = C.IPC_RMID
- IPC_SET = C.IPC_SET
- IPC_STAT = C.IPC_STAT
-)
-
-const (
- SHM_RDONLY = C.SHM_RDONLY
- SHM_RND = C.SHM_RND
-)
diff --git a/vendor/golang.org/x/sys/unix/types_dragonfly.go b/vendor/golang.org/x/sys/unix/types_dragonfly.go
deleted file mode 100644
index 32f8acf..0000000
--- a/vendor/golang.org/x/sys/unix/types_dragonfly.go
+++ /dev/null
@@ -1,274 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define KERNEL
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit
-
-type _Gid_t C.gid_t
-
-// Files
-
-type Stat_t C.struct_stat
-
-type Statfs_t C.struct_statfs
-
-type Flock_t C.struct_flock
-
-type Dirent C.struct_dirent
-
-type Fsid C.struct_fsid
-
-// File system limits
-
-const (
- PathMax = C.PATH_MAX
-)
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Linger C.struct_linger
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type Msghdr C.struct_msghdr
-
-type Cmsghdr C.struct_cmsghdr
-
-type Inet6Pktinfo C.struct_in6_pktinfo
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Ptrace requests
-
-const (
- PTRACE_TRACEME = C.PT_TRACE_ME
- PTRACE_CONT = C.PT_CONTINUE
- PTRACE_KILL = C.PT_KILL
-)
-
-// Events (kqueue, kevent)
-
-type Kevent_t C.struct_kevent
-
-// Select
-
-type FdSet C.fd_set
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
- SizeofIfData = C.sizeof_struct_if_data
- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
- SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
- SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
- SizeofRtMetrics = C.sizeof_struct_rt_metrics
-)
-
-type IfMsghdr C.struct_if_msghdr
-
-type IfData C.struct_if_data
-
-type IfaMsghdr C.struct_ifa_msghdr
-
-type IfmaMsghdr C.struct_ifma_msghdr
-
-type IfAnnounceMsghdr C.struct_if_announcemsghdr
-
-type RtMsghdr C.struct_rt_msghdr
-
-type RtMetrics C.struct_rt_metrics
-
-// Berkeley packet filter
-
-const (
- SizeofBpfVersion = C.sizeof_struct_bpf_version
- SizeofBpfStat = C.sizeof_struct_bpf_stat
- SizeofBpfProgram = C.sizeof_struct_bpf_program
- SizeofBpfInsn = C.sizeof_struct_bpf_insn
- SizeofBpfHdr = C.sizeof_struct_bpf_hdr
-)
-
-type BpfVersion C.struct_bpf_version
-
-type BpfStat C.struct_bpf_stat
-
-type BpfProgram C.struct_bpf_program
-
-type BpfInsn C.struct_bpf_insn
-
-type BpfHdr C.struct_bpf_hdr
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Winsize C.struct_winsize
-
-// fchmodat-like syscalls.
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
- AT_REMOVEDIR = C.AT_REMOVEDIR
- AT_EACCESS = C.AT_EACCESS
- AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
-)
-
-// poll
-
-type PollFd C.struct_pollfd
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-// Uname
-
-type Utsname C.struct_utsname
-
-// Clockinfo
-
-const SizeofClockinfo = C.sizeof_struct_clockinfo
-
-type Clockinfo C.struct_clockinfo
diff --git a/vendor/golang.org/x/sys/unix/types_freebsd.go b/vendor/golang.org/x/sys/unix/types_freebsd.go
deleted file mode 100644
index aab703c..0000000
--- a/vendor/golang.org/x/sys/unix/types_freebsd.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define _WANT_FREEBSD11_STAT 1
-#define _WANT_FREEBSD11_STATFS 1
-#define _WANT_FREEBSD11_DIRENT 1
-#define _WANT_FREEBSD11_KEVENT 1
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-// This structure is a duplicate of if_data on FreeBSD 8-STABLE.
-// See /usr/include/net/if.h.
-struct if_data8 {
- u_char ifi_type;
- u_char ifi_physical;
- u_char ifi_addrlen;
- u_char ifi_hdrlen;
- u_char ifi_link_state;
- u_char ifi_spare_char1;
- u_char ifi_spare_char2;
- u_char ifi_datalen;
- u_long ifi_mtu;
- u_long ifi_metric;
- u_long ifi_baudrate;
- u_long ifi_ipackets;
- u_long ifi_ierrors;
- u_long ifi_opackets;
- u_long ifi_oerrors;
- u_long ifi_collisions;
- u_long ifi_ibytes;
- u_long ifi_obytes;
- u_long ifi_imcasts;
- u_long ifi_omcasts;
- u_long ifi_iqdrops;
- u_long ifi_noproto;
- u_long ifi_hwassist;
-// FIXME: these are now unions, so maybe need to change definitions?
-#undef ifi_epoch
- time_t ifi_epoch;
-#undef ifi_lastchange
- struct timeval ifi_lastchange;
-};
-
-// This structure is a duplicate of if_msghdr on FreeBSD 8-STABLE.
-// See /usr/include/net/if.h.
-struct if_msghdr8 {
- u_short ifm_msglen;
- u_char ifm_version;
- u_char ifm_type;
- int ifm_addrs;
- int ifm_flags;
- u_short ifm_index;
- struct if_data8 ifm_data;
-};
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-type Time_t C.time_t
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit
-
-type _Gid_t C.gid_t
-
-// Files
-
-const (
- _statfsVersion = C.STATFS_VERSION
- _dirblksiz = C.DIRBLKSIZ
-)
-
-type Stat_t C.struct_stat
-
-type stat_freebsd11_t C.struct_freebsd11_stat
-
-type Statfs_t C.struct_statfs
-
-type statfs_freebsd11_t C.struct_freebsd11_statfs
-
-type Flock_t C.struct_flock
-
-type Dirent C.struct_dirent
-
-type dirent_freebsd11 C.struct_freebsd11_dirent
-
-type Fsid C.struct_fsid
-
-// File system limits
-
-const (
- PathMax = C.PATH_MAX
-)
-
-// Advice to Fadvise
-
-const (
- FADV_NORMAL = C.POSIX_FADV_NORMAL
- FADV_RANDOM = C.POSIX_FADV_RANDOM
- FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
- FADV_WILLNEED = C.POSIX_FADV_WILLNEED
- FADV_DONTNEED = C.POSIX_FADV_DONTNEED
- FADV_NOREUSE = C.POSIX_FADV_NOREUSE
-)
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Xucred C.struct_xucred
-
-type Linger C.struct_linger
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPMreqn C.struct_ip_mreqn
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type Msghdr C.struct_msghdr
-
-type Cmsghdr C.struct_cmsghdr
-
-type Inet6Pktinfo C.struct_in6_pktinfo
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofXucred = C.sizeof_struct_xucred
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPMreqn = C.sizeof_struct_ip_mreqn
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Ptrace requests
-
-const (
- PTRACE_ATTACH = C.PT_ATTACH
- PTRACE_CONT = C.PT_CONTINUE
- PTRACE_DETACH = C.PT_DETACH
- PTRACE_GETFPREGS = C.PT_GETFPREGS
- PTRACE_GETFSBASE = C.PT_GETFSBASE
- PTRACE_GETLWPLIST = C.PT_GETLWPLIST
- PTRACE_GETNUMLWPS = C.PT_GETNUMLWPS
- PTRACE_GETREGS = C.PT_GETREGS
- PTRACE_GETXSTATE = C.PT_GETXSTATE
- PTRACE_IO = C.PT_IO
- PTRACE_KILL = C.PT_KILL
- PTRACE_LWPEVENTS = C.PT_LWP_EVENTS
- PTRACE_LWPINFO = C.PT_LWPINFO
- PTRACE_SETFPREGS = C.PT_SETFPREGS
- PTRACE_SETREGS = C.PT_SETREGS
- PTRACE_SINGLESTEP = C.PT_STEP
- PTRACE_TRACEME = C.PT_TRACE_ME
-)
-
-const (
- PIOD_READ_D = C.PIOD_READ_D
- PIOD_WRITE_D = C.PIOD_WRITE_D
- PIOD_READ_I = C.PIOD_READ_I
- PIOD_WRITE_I = C.PIOD_WRITE_I
-)
-
-const (
- PL_FLAG_BORN = C.PL_FLAG_BORN
- PL_FLAG_EXITED = C.PL_FLAG_EXITED
- PL_FLAG_SI = C.PL_FLAG_SI
-)
-
-const (
- TRAP_BRKPT = C.TRAP_BRKPT
- TRAP_TRACE = C.TRAP_TRACE
-)
-
-type PtraceLwpInfoStruct C.struct_ptrace_lwpinfo
-
-type __Siginfo C.struct___siginfo
-
-type Sigset_t C.sigset_t
-
-type Reg C.struct_reg
-
-type FpReg C.struct_fpreg
-
-type PtraceIoDesc C.struct_ptrace_io_desc
-
-// Events (kqueue, kevent)
-
-type Kevent_t C.struct_kevent_freebsd11
-
-// Select
-
-type FdSet C.fd_set
-
-// Routing and interface messages
-
-const (
- sizeofIfMsghdr = C.sizeof_struct_if_msghdr
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr8
- sizeofIfData = C.sizeof_struct_if_data
- SizeofIfData = C.sizeof_struct_if_data8
- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
- SizeofIfmaMsghdr = C.sizeof_struct_ifma_msghdr
- SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
- SizeofRtMetrics = C.sizeof_struct_rt_metrics
-)
-
-type ifMsghdr C.struct_if_msghdr
-
-type IfMsghdr C.struct_if_msghdr8
-
-type ifData C.struct_if_data
-
-type IfData C.struct_if_data8
-
-type IfaMsghdr C.struct_ifa_msghdr
-
-type IfmaMsghdr C.struct_ifma_msghdr
-
-type IfAnnounceMsghdr C.struct_if_announcemsghdr
-
-type RtMsghdr C.struct_rt_msghdr
-
-type RtMetrics C.struct_rt_metrics
-
-// Berkeley packet filter
-
-const (
- SizeofBpfVersion = C.sizeof_struct_bpf_version
- SizeofBpfStat = C.sizeof_struct_bpf_stat
- SizeofBpfZbuf = C.sizeof_struct_bpf_zbuf
- SizeofBpfProgram = C.sizeof_struct_bpf_program
- SizeofBpfInsn = C.sizeof_struct_bpf_insn
- SizeofBpfHdr = C.sizeof_struct_bpf_hdr
- SizeofBpfZbufHeader = C.sizeof_struct_bpf_zbuf_header
-)
-
-type BpfVersion C.struct_bpf_version
-
-type BpfStat C.struct_bpf_stat
-
-type BpfZbuf C.struct_bpf_zbuf
-
-type BpfProgram C.struct_bpf_program
-
-type BpfInsn C.struct_bpf_insn
-
-type BpfHdr C.struct_bpf_hdr
-
-type BpfZbufHeader C.struct_bpf_zbuf_header
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Winsize C.struct_winsize
-
-// fchmodat-like syscalls.
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_EACCESS = C.AT_EACCESS
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
- AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
- AT_REMOVEDIR = C.AT_REMOVEDIR
-)
-
-// poll
-
-type PollFd C.struct_pollfd
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLINIGNEOF = C.POLLINIGNEOF
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-// Capabilities
-
-type CapRights C.struct_cap_rights
-
-// Uname
-
-type Utsname C.struct_utsname
-
-// Clockinfo
-
-const SizeofClockinfo = C.sizeof_struct_clockinfo
-
-type Clockinfo C.struct_clockinfo
diff --git a/vendor/golang.org/x/sys/unix/types_illumos.go b/vendor/golang.org/x/sys/unix/types_illumos.go
deleted file mode 100644
index d47ab63..0000000
--- a/vendor/golang.org/x/sys/unix/types_illumos.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2021 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-package unix
-
-/*
-#include
-#include
-#include
-
-// Many illumos distributions ship a 3rd party tun/tap driver
-// from https://github.com/kaizawa/tuntap
-// It supports a pair of IOCTLs defined at
-// https://github.com/kaizawa/tuntap/blob/master/if_tun.h#L91-L93
-#define TUNNEWPPA (('T'<<16) | 0x0001)
-#define TUNSETPPA (('T'<<16) | 0x0002)
-*/
-import "C"
-
-const (
- TUNNEWPPA = C.TUNNEWPPA
- TUNSETPPA = C.TUNSETPPA
-
- // sys/stropts.h:
- I_STR = C.I_STR
- I_POP = C.I_POP
- I_PUSH = C.I_PUSH
- I_LINK = C.I_LINK
- I_UNLINK = C.I_UNLINK
- I_PLINK = C.I_PLINK
- I_PUNLINK = C.I_PUNLINK
-
- // sys/sockio.h:
- IF_UNITSEL = C.IF_UNITSEL
-)
-
-type strbuf C.struct_strbuf
-
-type Strioctl C.struct_strioctl
-
-type Lifreq C.struct_lifreq
diff --git a/vendor/golang.org/x/sys/unix/types_netbsd.go b/vendor/golang.org/x/sys/unix/types_netbsd.go
deleted file mode 100644
index 9e7d654..0000000
--- a/vendor/golang.org/x/sys/unix/types_netbsd.go
+++ /dev/null
@@ -1,304 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define KERNEL
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit
-
-type _Gid_t C.gid_t
-
-// Files
-
-type Stat_t C.struct_stat
-
-type Statfs_t C.struct_statfs
-
-type Statvfs_t C.struct_statvfs
-
-type Flock_t C.struct_flock
-
-type Dirent C.struct_dirent
-
-type Fsid C.fsid_t
-
-// File system limits
-
-const (
- PathMax = C.PATH_MAX
-)
-
-// Fstatvfs/Statvfs flags
-
-const (
- ST_WAIT = C.ST_WAIT
- ST_NOWAIT = C.ST_NOWAIT
-)
-
-// Advice to Fadvise
-
-const (
- FADV_NORMAL = C.POSIX_FADV_NORMAL
- FADV_RANDOM = C.POSIX_FADV_RANDOM
- FADV_SEQUENTIAL = C.POSIX_FADV_SEQUENTIAL
- FADV_WILLNEED = C.POSIX_FADV_WILLNEED
- FADV_DONTNEED = C.POSIX_FADV_DONTNEED
- FADV_NOREUSE = C.POSIX_FADV_NOREUSE
-)
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Linger C.struct_linger
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type Msghdr C.struct_msghdr
-
-type Cmsghdr C.struct_cmsghdr
-
-type Inet6Pktinfo C.struct_in6_pktinfo
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Ptrace requests
-
-const (
- PTRACE_TRACEME = C.PT_TRACE_ME
- PTRACE_CONT = C.PT_CONTINUE
- PTRACE_KILL = C.PT_KILL
-)
-
-// Events (kqueue, kevent)
-
-type Kevent_t C.struct_kevent
-
-// Select
-
-type FdSet C.fd_set
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
- SizeofIfData = C.sizeof_struct_if_data
- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
- SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
- SizeofRtMetrics = C.sizeof_struct_rt_metrics
-)
-
-type IfMsghdr C.struct_if_msghdr
-
-type IfData C.struct_if_data
-
-type IfaMsghdr C.struct_ifa_msghdr
-
-type IfAnnounceMsghdr C.struct_if_announcemsghdr
-
-type RtMsghdr C.struct_rt_msghdr
-
-type RtMetrics C.struct_rt_metrics
-
-type Mclpool C.struct_mclpool
-
-// Berkeley packet filter
-
-const (
- SizeofBpfVersion = C.sizeof_struct_bpf_version
- SizeofBpfStat = C.sizeof_struct_bpf_stat
- SizeofBpfProgram = C.sizeof_struct_bpf_program
- SizeofBpfInsn = C.sizeof_struct_bpf_insn
- SizeofBpfHdr = C.sizeof_struct_bpf_hdr
-)
-
-type BpfVersion C.struct_bpf_version
-
-type BpfStat C.struct_bpf_stat
-
-type BpfProgram C.struct_bpf_program
-
-type BpfInsn C.struct_bpf_insn
-
-type BpfHdr C.struct_bpf_hdr
-
-type BpfTimeval C.struct_bpf_timeval
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Winsize C.struct_winsize
-
-type Ptmget C.struct_ptmget
-
-// fchmodat-like syscalls.
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_EACCESS = C.AT_EACCESS
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
- AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
- AT_REMOVEDIR = C.AT_REMOVEDIR
-)
-
-// poll
-
-type PollFd C.struct_pollfd
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-// Sysctl
-
-type Sysctlnode C.struct_sysctlnode
-
-// Uname
-
-type Utsname C.struct_utsname
-
-// Clockinfo
-
-const SizeofClockinfo = C.sizeof_struct_clockinfo
-
-type Clockinfo C.struct_clockinfo
diff --git a/vendor/golang.org/x/sys/unix/types_openbsd.go b/vendor/golang.org/x/sys/unix/types_openbsd.go
deleted file mode 100644
index 4a4ba63..0000000
--- a/vendor/golang.org/x/sys/unix/types_openbsd.go
+++ /dev/null
@@ -1,287 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define KERNEL
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-enum {
- sizeofPtr = sizeof(void*),
-};
-
-union sockaddr_all {
- struct sockaddr s1; // this one gets used for fields
- struct sockaddr_in s2; // these pad it out
- struct sockaddr_in6 s3;
- struct sockaddr_un s4;
- struct sockaddr_dl s5;
-};
-
-struct sockaddr_any {
- struct sockaddr addr;
- char pad[sizeof(union sockaddr_all) - sizeof(struct sockaddr)];
-};
-
-*/
-import "C"
-
-// Machine characteristics
-
-const (
- SizeofPtr = C.sizeofPtr
- SizeofShort = C.sizeof_short
- SizeofInt = C.sizeof_int
- SizeofLong = C.sizeof_long
- SizeofLongLong = C.sizeof_longlong
-)
-
-// Basic types
-
-type (
- _C_short C.short
- _C_int C.int
- _C_long C.long
- _C_long_long C.longlong
-)
-
-// Time
-
-type Timespec C.struct_timespec
-
-type Timeval C.struct_timeval
-
-// Processes
-
-type Rusage C.struct_rusage
-
-type Rlimit C.struct_rlimit
-
-type _Gid_t C.gid_t
-
-// Files
-
-type Stat_t C.struct_stat
-
-type Statfs_t C.struct_statfs
-
-type Flock_t C.struct_flock
-
-type Dirent C.struct_dirent
-
-type Fsid C.fsid_t
-
-// File system limits
-
-const (
- PathMax = C.PATH_MAX
-)
-
-// Sockets
-
-type RawSockaddrInet4 C.struct_sockaddr_in
-
-type RawSockaddrInet6 C.struct_sockaddr_in6
-
-type RawSockaddrUnix C.struct_sockaddr_un
-
-type RawSockaddrDatalink C.struct_sockaddr_dl
-
-type RawSockaddr C.struct_sockaddr
-
-type RawSockaddrAny C.struct_sockaddr_any
-
-type _Socklen C.socklen_t
-
-type Linger C.struct_linger
-
-type Iovec C.struct_iovec
-
-type IPMreq C.struct_ip_mreq
-
-type IPv6Mreq C.struct_ipv6_mreq
-
-type Msghdr C.struct_msghdr
-
-type Cmsghdr C.struct_cmsghdr
-
-type Inet6Pktinfo C.struct_in6_pktinfo
-
-type IPv6MTUInfo C.struct_ip6_mtuinfo
-
-type ICMPv6Filter C.struct_icmp6_filter
-
-const (
- SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
- SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
- SizeofSockaddrAny = C.sizeof_struct_sockaddr_any
- SizeofSockaddrUnix = C.sizeof_struct_sockaddr_un
- SizeofSockaddrDatalink = C.sizeof_struct_sockaddr_dl
- SizeofLinger = C.sizeof_struct_linger
- SizeofIovec = C.sizeof_struct_iovec
- SizeofIPMreq = C.sizeof_struct_ip_mreq
- SizeofIPv6Mreq = C.sizeof_struct_ipv6_mreq
- SizeofMsghdr = C.sizeof_struct_msghdr
- SizeofCmsghdr = C.sizeof_struct_cmsghdr
- SizeofInet6Pktinfo = C.sizeof_struct_in6_pktinfo
- SizeofIPv6MTUInfo = C.sizeof_struct_ip6_mtuinfo
- SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
-)
-
-// Ptrace requests
-
-const (
- PTRACE_TRACEME = C.PT_TRACE_ME
- PTRACE_CONT = C.PT_CONTINUE
- PTRACE_KILL = C.PT_KILL
-)
-
-// Events (kqueue, kevent)
-
-type Kevent_t C.struct_kevent
-
-// Select
-
-type FdSet C.fd_set
-
-// Routing and interface messages
-
-const (
- SizeofIfMsghdr = C.sizeof_struct_if_msghdr
- SizeofIfData = C.sizeof_struct_if_data
- SizeofIfaMsghdr = C.sizeof_struct_ifa_msghdr
- SizeofIfAnnounceMsghdr = C.sizeof_struct_if_announcemsghdr
- SizeofRtMsghdr = C.sizeof_struct_rt_msghdr
- SizeofRtMetrics = C.sizeof_struct_rt_metrics
-)
-
-type IfMsghdr C.struct_if_msghdr
-
-type IfData C.struct_if_data
-
-type IfaMsghdr C.struct_ifa_msghdr
-
-type IfAnnounceMsghdr C.struct_if_announcemsghdr
-
-type RtMsghdr C.struct_rt_msghdr
-
-type RtMetrics C.struct_rt_metrics
-
-type Mclpool C.struct_mclpool
-
-// Berkeley packet filter
-
-const (
- SizeofBpfVersion = C.sizeof_struct_bpf_version
- SizeofBpfStat = C.sizeof_struct_bpf_stat
- SizeofBpfProgram = C.sizeof_struct_bpf_program
- SizeofBpfInsn = C.sizeof_struct_bpf_insn
- SizeofBpfHdr = C.sizeof_struct_bpf_hdr
-)
-
-type BpfVersion C.struct_bpf_version
-
-type BpfStat C.struct_bpf_stat
-
-type BpfProgram C.struct_bpf_program
-
-type BpfInsn C.struct_bpf_insn
-
-type BpfHdr C.struct_bpf_hdr
-
-type BpfTimeval C.struct_bpf_timeval
-
-// Terminal handling
-
-type Termios C.struct_termios
-
-type Winsize C.struct_winsize
-
-// fchmodat-like syscalls.
-
-const (
- AT_FDCWD = C.AT_FDCWD
- AT_EACCESS = C.AT_EACCESS
- AT_SYMLINK_NOFOLLOW = C.AT_SYMLINK_NOFOLLOW
- AT_SYMLINK_FOLLOW = C.AT_SYMLINK_FOLLOW
- AT_REMOVEDIR = C.AT_REMOVEDIR
-)
-
-// poll
-
-type PollFd C.struct_pollfd
-
-const (
- POLLERR = C.POLLERR
- POLLHUP = C.POLLHUP
- POLLIN = C.POLLIN
- POLLNVAL = C.POLLNVAL
- POLLOUT = C.POLLOUT
- POLLPRI = C.POLLPRI
- POLLRDBAND = C.POLLRDBAND
- POLLRDNORM = C.POLLRDNORM
- POLLWRBAND = C.POLLWRBAND
- POLLWRNORM = C.POLLWRNORM
-)
-
-// Signal Sets
-
-type Sigset_t C.sigset_t
-
-// Uname
-
-type Utsname C.struct_utsname
-
-// Uvmexp
-
-const SizeofUvmexp = C.sizeof_struct_uvmexp
-
-type Uvmexp C.struct_uvmexp
-
-// Clockinfo
-
-const SizeofClockinfo = C.sizeof_struct_clockinfo
-
-type Clockinfo C.struct_clockinfo
diff --git a/vendor/golang.org/x/sys/unix/types_solaris.go b/vendor/golang.org/x/sys/unix/types_solaris.go
deleted file mode 100644
index 5360e5d..0000000
--- a/vendor/golang.org/x/sys/unix/types_solaris.go
+++ /dev/null
@@ -1,302 +0,0 @@
-// Copyright 2009 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.
-
-//go:build ignore
-// +build ignore
-
-/*
-Input to cgo -godefs. See README.md
-*/
-
-// +godefs map struct_in_addr [4]byte /* in_addr */
-// +godefs map struct_in6_addr [16]byte /* in6_addr */
-
-package unix
-
-/*
-#define KERNEL
-// These defines ensure that builds done on newer versions of Solaris are
-// backwards-compatible with older versions of Solaris and
-// OpenSolaris-based derivatives.
-#define __USE_SUNOS_SOCKETS__ // msghdr
-#define __USE_LEGACY_PROTOTYPES__ // iovec
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include |
|