diff --git a/go.mod b/go.mod index 1e6ff57f..8d69c89e 100644 --- a/go.mod +++ b/go.mod @@ -9,9 +9,9 @@ require ( github.com/charmbracelet/lipgloss v1.1.0 github.com/charmbracelet/x/ansi v0.11.8 github.com/jessevdk/go-flags v1.6.1 - github.com/mattn/go-runewidth v0.0.27 + github.com/mattn/go-runewidth v0.0.28 github.com/muesli/termenv v0.16.0 - github.com/stretchr/testify v1.12.0 + github.com/stretchr/testify v1.12.1 ) require ( @@ -22,17 +22,17 @@ require ( github.com/charmbracelet/x/term v0.2.2 // indirect github.com/clipperhouse/displaywidth v0.11.0 // indirect github.com/clipperhouse/uax29/v2 v2.7.0 // indirect - github.com/dlclark/regexp2/v2 v2.2.1 // indirect + github.com/dlclark/regexp2/v2 v2.7.1 // indirect github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect - github.com/lucasb-eyer/go-colorful v1.4.0 // indirect - github.com/mattn/go-isatty v0.0.22 // indirect + github.com/lucasb-eyer/go-colorful v1.4.1 // indirect + github.com/mattn/go-isatty v0.0.24 // indirect github.com/mattn/go-localereader v0.0.1 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect + github.com/xo/terminfo v1.0.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect - golang.org/x/sys v0.43.0 // indirect - golang.org/x/text v0.36.0 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.41.0 // indirect ) diff --git a/go.sum b/go.sum index 66de9154..a352b247 100644 --- a/go.sum +++ b/go.sum @@ -26,22 +26,22 @@ github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSE github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0= github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk= github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM= -github.com/dlclark/regexp2/v2 v2.2.1 h1:mf4KkFUj0gJuarK8P+LgiS+Lit7m9N1yAwEfPbee7R0= -github.com/dlclark/regexp2/v2 v2.2.1/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= +github.com/dlclark/regexp2/v2 v2.7.1 h1:yqDtwI1ptXXvEUNpYTk2lad4jLtAcKqkzepn4savSk4= +github.com/dlclark/regexp2/v2 v2.7.1/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4= github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/jessevdk/go-flags v1.6.1 h1:Cvu5U8UGrLay1rZfv/zP7iLpSHGUZ/Ou68T0iX1bBK4= github.com/jessevdk/go-flags v1.6.1/go.mod h1:Mk8T1hIAWpOiJiHa9rJASDK2UGWji0EuPGBnNLMooyc= -github.com/lucasb-eyer/go-colorful v1.4.0 h1:UtrWVfLdarDgc44HcS7pYloGHJUjHV/4FwW4TvVgFr4= -github.com/lucasb-eyer/go-colorful v1.4.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= -github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= -github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= +github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss= +github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI= +github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A= github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4= github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88= -github.com/mattn/go-runewidth v0.0.27 h1:Feg/Oou5zI/wnpgDF6omIU0OokC9GxLC/WRknhVlIR0= -github.com/mattn/go-runewidth v0.0.27/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= +github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU= +github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI= github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo= github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA= @@ -50,18 +50,16 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/stretchr/testify v1.12.0 h1:K6Mr6jO9JICuend/5xzTM03ydSV3vdNRYAdPSukj8uI= -github.com/stretchr/testify v1.12.0/go.mod h1:bOYBZb5qJ00vPzWfIqBUZPaxK8jWiXc6d3ErP4Ca9Gw= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no= -github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/xo/terminfo v1.0.0 h1:2ZpYzqWzyyytjk3TP6aJVDhkMAkc99/1xKQdA3TDTBY= +github.com/xo/terminfo v1.0.0/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= -golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= -golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8= +golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M= diff --git a/vendor/github.com/dlclark/regexp2/v2/README.md b/vendor/github.com/dlclark/regexp2/v2/README.md index f49a0d05..0095bf40 100644 --- a/vendor/github.com/dlclark/regexp2/v2/README.md +++ b/vendor/github.com/dlclark/regexp2/v2/README.md @@ -38,7 +38,7 @@ if isMatch, _ := re.MatchString(`Something to match`); isMatch { } ``` -The only error that the `*Match*` methods *should* return is a Timeout if you set the `re.MatchTimeout` field. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: +The `*Match*` methods can return a timeout error if you set the `re.MatchTimeout` field, or `ErrBacktrackingStackLimit` if a match exceeds its configured backtracking stack size. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: ```go if m, _ := re.FindStringMatch(`Something to match`); m != nil { @@ -92,6 +92,17 @@ notEmoji := regexp2.MustCompile(`\P{Emoji}+`) Valid property names and aliases come from Unicode 17.0.0 [`PropertyAliases.txt`](https://www.unicode.org/Public/17.0.0/ucd/PropertyAliases.txt). Valid property values and aliases come from Unicode 17.0.0 [`PropertyValueAliases.txt`](https://www.unicode.org/Public/17.0.0/ucd/PropertyValueAliases.txt). The generated tables use Unicode 17.0.0 data from [`DerivedCoreProperties.txt`](https://www.unicode.org/Public/17.0.0/ucd/DerivedCoreProperties.txt), [`emoji/emoji-data.txt`](https://www.unicode.org/Public/17.0.0/ucd/emoji/emoji-data.txt), [`auxiliary/GraphemeBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/GraphemeBreakProperty.txt), [`auxiliary/WordBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/WordBreakProperty.txt), and [`auxiliary/SentenceBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/SentenceBreakProperty.txt) for the package-local properties whose data changes more frequently than the Go standard library tables. +## Additional Perl and PCRE syntax + +The default mode supports the following syntax: + +* `\Q...\E` quotes every character between `\Q` and `\E`. If `\E` is omitted, quoting continues to the end of the pattern. This also works inside character classes. +* `\R` matches one Unicode newline sequence: CRLF as a single sequence, or LF, VT, FF, CR, NEL, line separator, or paragraph separator. +* `\X` atomically matches one Unicode 17.0.0 extended grapheme cluster. This includes combining sequences, Hangul syllables, regional-indicator pairs, emoji ZWJ sequences, and Indic conjuncts. +* A `+` after a quantifier makes it possessive: `*+`, `++`, `?+`, and `{m,n}+`. For example, `a*+` is equivalent to `(?>a*)` and will not give characters back when the remainder of the pattern fails. + +`RE2` mode also supports `\Q...\E` and possessive quantifiers, but keeps `\R` and `\X` as literal `R` and `X` identity escapes. `ECMAScript` mode does not enable any of this syntax: `\Q`, `\E`, `\R`, and `\X` retain ECMAScript identity-escape behavior, and possessive quantifiers remain invalid. + ## `regexp` compatibility adapter The `github.com/dlclark/regexp2/v2/compat` package provides an adapter for callers that want the same `Find*` and `Match*` method signatures as the standard library's `regexp.Regexp`, while still using the `regexp2` engine. @@ -128,7 +139,7 @@ func findWords(re compat.Matcher, input string) []string { } ``` -Because those standard-library method signatures do not return errors, the adapter panics if the wrapped regexp2 matcher returns an error such as a match timeout. Use the main `regexp2` APIs directly when you need to handle timeouts as errors. +Because those standard-library method signatures do not return errors, the adapter panics if the wrapped regexp2 matcher returns an error such as a match timeout or `ErrBacktrackingStackLimit`. Use the main `regexp2` APIs directly when you need to handle match errors directly. ## Compile options @@ -146,6 +157,7 @@ Performance tuning options override the default cache settings: ```go re := regexp2.MustCompile(`Your pattern`, regexp2.IgnoreCase, + regexp2.OptionMaxBacktrackingStackSize(200000), regexp2.OptionMaxCachedRuneBufferLength(64*1024), regexp2.OptionMaxCachedReplacerDataEntries(8), ) @@ -164,23 +176,30 @@ The defaults are intentionally bounded: | `OptionMaintainCaptureOrder()` | false | Parser capture-slot assignment for mixed named and unnamed captures. | None at match time. This changes compile-time capture numbering only. | Keeps named and unnamed captures in pattern order instead of appending named captures after unnamed captures. This can change numeric backreference meaning, so it is caller-controlled rather than an inline regex option. | | `OptionDebug()` | false | Compile dumps and runner tracing. | Debug output volume only. | Useful for diagnostics, but it can produce noisy output and slower traced matching. | | `OptionIsCodeGen()` | false | Compile-time find-optimization analysis for [`regexp2cg`](https://github.com/dlclark/regexp2cg). | Per compiled regexp, during `Compile` or `MustCompile`. | Enables more expensive analysis intended for generated engines. Do not use it for normal interpreter execution; the interpreter defaults intentionally avoid this extra compile-time cost. | +| `OptionMaxBacktrackingStackSize(n)` | 100,000 | The interpreter's per-match backtracking stack. | Per pooled runner. The initial allocation and subsequent growth are capped at the configured number of integer slots; the runner pool may retain stacks at their high-water size for reuse. | Lowering this bounds backtracking memory more tightly but may reject complex matches sooner with `ErrBacktrackingStackLimit`. Raising it permits deeper backtracking and increases possible memory use. A negative value disables the limit. | | `OptionMaxCachedRuneBufferLength(n)` | 256K runes | String APIs that run through pooled runners, such as `MatchString` and replacement-pattern `Replace`, when converting input strings to the engine's internal `[]rune` representation. | Process-wide shared `sync.Pool` retention by size class. This does not grow per compiled regexp or per input string; the practical working set follows recent and concurrent use across all regexps and can be dropped by GC. | Raising this lets calls use larger pooled rune buffers and can reduce allocations for repeated matches against large strings. Lowering it prevents larger buffers from being borrowed or returned, so large inputs allocate directly. | | `OptionMaxCachedReplaceBufferLength(n)` | 256 KB | Replacement-pattern `Replace` calls that build output through a shared byte buffer. | Process-wide shared `sync.Pool` retention by size class after replacement-pattern `Replace` runs. It does not grow from evaluator-based `ReplaceFunc` output and is shared across compiled regexps. | Raising this lets larger replacement outputs use pooled buffers and can reduce allocations. Lowering it prevents larger output buffers from being retained, so large replacements allocate directly. | | `OptionMaxCachedReplacerDataEntries(n)` | `16` | `Replace` with replacement pattern strings, after the replacement pattern is parsed into reusable replacement data. | Per compiled regexp. The cache grows as distinct cacheable replacement strings are used with `Replace`, up to this entry count. | Raising this helps when a single compiled regexp is used with many recurring replacement patterns. It increases per-regexp cache memory and lock-protected cache bookkeeping. Setting it to `0` disables this cache. | | `OptionMaxCachedReplacerDataBytes(n)` | 4 KB | The parsed replacement-pattern cache. Replacement strings longer than this are parsed for the call but not retained. | Per compiled regexp, combined with `OptionMaxCachedReplacerDataEntries`. Only replacement strings whose source text is at or below this size can add parsed data to the cache. | Raising this helps if large replacement patterns are reused. It can retain more memory per cached replacement. Lowering it avoids keeping unusual large replacement patterns around. | | `OptionDisableCharClassASCIIBitmap()` | false | Compile-time preparation of character classes and first-character prefix sets. By default, character classes with ASCII membership get a small bitmap used by `CharIn`. | Per compiled regexp, during `Compile` or `MustCompile`. Each eligible character class can hold one small bitmap; this does not scale with match concurrency or input size. | Leaving this false speeds up ASCII-heavy character class checks at the cost of a small amount of per-char-class memory and compile-time work. Setting to true can reduce memory for large numbers of compiled char classes in regexps, but ASCII character class matching may be slower. | +For `OptionMaxBacktrackingStackSize`, set `n` to a negative value to allow unbounded stack growth. Setting it to `0` permits no backtracking stack entries, so most interpreted matches will return `ErrBacktrackingStackLimit`. + For pooled buffer cache options, set `n` to `0` to disable pooling, or `-1` to allow all built-in size classes. The rune buffer classes are 1K, 4K, 16K, 64K, and 256K runes. The replacement byte buffer classes are 4 KB, 16 KB, 64 KB, 256 KB, and 1 MB. By default the 1 MB pool is unused. For replacement data byte-size cache options, `-1` means unbounded. For entry-count cache options, set `n` to `0` to disable the cache. ## Compare `regexp` and `regexp2` | Category | regexp | regexp2 | | --- | --- | --- | -| Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field | +| Catastrophic backtracking possible | no, constant execution time guarantees | yes; backtracking stack growth is bounded by default, and `re.MatchTimeout` can also bound match duration | | Python-style capture groups `(?Pre)` | yes | no (yes in RE2 compat mode) | | .NET-style capture groups `(?re)` or `(?'name're)` | yes | yes | | comments `(?#comment)` | no | yes | | branch numbering reset `(?\|a\|b)` | no | no | -| possessive match `(?>re)` | no | yes | +| atomic group `(?>re)` | no | yes | +| possessive quantifiers `*+`, `++`, `?+`, `{m,n}+` | no | yes | +| literal quoting `\Q...\E` | yes | yes | +| Unicode newline sequence `\R` | no | yes (default mode only) | +| extended grapheme cluster `\X` | no | yes (default mode only) | | positive lookahead `(?=re)` | no | yes | | negative lookahead `(?!re)` | no | yes | | positive lookbehind `(?<=re)` | no | yes | @@ -199,6 +218,8 @@ The default behavior of `regexp2` is to match the .NET regexp engine, however th * 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 `_` +* support RE2-style literal quoting with `\Q...\E` +* support possessive quantifiers (`*+`, `++`, `?+`, and `{m,n}+`) as a regexp2 extension ```go re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2) @@ -212,7 +233,22 @@ This feature is a work in progress and I'm open to ideas for more things to put ## 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 +Each compiled regexp limits its per-match backtracking stack to 100,000 +slots by default. If a match would exceed that limit, it stops and returns +`ErrBacktrackingStackLimit`. Callers can identify it with +`errors.Is(err, regexp2.ErrBacktrackingStackLimit)`. The limit can be changed at +compile time; a negative value restores the previous unbounded behavior: + +```go +re := regexp2.MustCompile(pattern, regexp2.OptionMaxBacktrackingStackSize(200000)) +// regexp2.OptionMaxBacktrackingStackSize(-1) disables the limit. +``` + +This limit bounds the interpreter's backtracking stack, not total match time or +all memory used by a match. Literal empty expressions repeated any number of +times are optimized away and do not consume backtracking stack space. + +`Regexp.MatchTimeout` can be set to limit the impact of such behavior; the match will fail with an error after approximately MatchTimeout. No timeout checks are done by default. @@ -276,6 +312,8 @@ This flag should not be treated as compatibility with C#'s `RegexOptions.ECMAScr Additionally a Unicode mode is provided which allows parsing of `\u{CodePoint}` syntax only when both `ECMAScript` and `Unicode` are provided. +Perl/PCRE extensions `\Q...\E`, `\R`, `\X`, and possessive quantifiers are intentionally not enabled in this mode. The letter escapes retain the engine's existing ECMAScript identity-escape behavior. + ## Potential bugs I've run a battery of tests against regexp2 from various sources and found the debug output matches the .NET engine, but .NET and Go handle strings very differently. I've attempted to handle these differences, but most of my testing deals with basic ASCII with a little bit of multi-byte Unicode. There's a chance that there are bugs in the string handling related to character sets with supplementary Unicode chars. Right-to-Left support is coded, but not well tested either. diff --git a/vendor/github.com/dlclark/regexp2/v2/decode.go b/vendor/github.com/dlclark/regexp2/v2/decode.go new file mode 100644 index 00000000..6427e548 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/decode.go @@ -0,0 +1,152 @@ +package regexp2 + +import ( + "unicode/utf8" + + "github.com/dlclark/regexp2/v2/helpers" +) + +// decodedInput is the engine's rune view of a string. When the pattern cannot +// look behind a candidate start, the slice may begin at that candidate instead +// of byte 0. +type decodedInput struct { + runes []rune + pooled *[]rune + runeStart int // index in runes of the requested startAt; -1 if not a rune boundary + runeOffset int // original-string rune index of runes[0] + byteOffset int // original-string byte index of runes[0] +} + +// decodeFrom is the first original-string byte that must be decoded. 0 means +// the whole string; a later index is only used when slicing is safe. +func (re *Regexp) decodeFrom(s string, startAt int) int { + if startAt <= 0 || re.RightToLeft() { + return 0 + } + need := re.decodeLeftContextRunes() + if need < 0 { + return 0 + } + if need > 0 { + return prevRuneByte(s, startAt) + } + return startAt +} + +func (re *Regexp) decodeLeftContextRunes() int { + if re.code != nil { + return re.code.LeftContextRunes + } + return re.leftContextRunes +} + +// decodeString converts s to []rune for the MatchString startAt<=0 path. +// Keep this as close as possible to a single UTF-8 walk so 4–30 byte +// matches stay cheap. +func decodeString(s string, maxCachedLength int) ([]rune, *[]rune) { + buf, pooled := pooledRuneBuffers.get(len(s), maxCachedLength) + if len(s) >= helpers.ASCIIScanMin { + n, _ := helpers.DecodeString(s, buf) + return buf[:n], pooled + } + n := 0 + for _, ch := range s { + buf[n] = ch + n++ + } + return buf[:n], pooled +} + +func (re *Regexp) decodeStringInput(s string, startAt int, pooled bool) decodedInput { + maxCachedLength := 0 + if pooled { + maxCachedLength = re.optimizations.MaxCachedRuneBufferLength + } + return decodeInput(s, startAt, re.decodeFrom(s, startAt), maxCachedLength, true) +} + +// decodeInput converts s[decodeFrom:] to runes. startAt is a byte index in s. +// If startAt < 0 or is not a rune boundary, runeStart is -1. needOffsets walks +// the skipped prefix to fill runeOffset; MatchString does not need that field. +func decodeInput(s string, startAt, decodeFrom, maxCachedLength int, needOffsets bool) decodedInput { + if decodeFrom < 0 { + decodeFrom = 0 + } + if decodeFrom > len(s) { + decodeFrom = len(s) + } + + substr := s[decodeFrom:] + buf, pooledBuffer := pooledRuneBuffers.get(len(substr), maxCachedLength) + n, ascii := helpers.DecodeString(substr, buf) + runes := buf[:n] + + out := decodedInput{ + runes: runes, + pooled: pooledBuffer, + byteOffset: decodeFrom, + runeStart: startRuneIndex(s, startAt, decodeFrom, n, ascii), + } + + if !needOffsets { + return out + } + + // Byte index equals rune index only when the skipped prefix is also ASCII. + if ascii && (decodeFrom == 0 || helpers.IsASCII(s[:decodeFrom])) { + out.runeOffset = decodeFrom + return out + } + if decodeFrom > 0 { + out.runeOffset = utf8.RuneCountInString(s[:decodeFrom]) + } + return out +} + +func startRuneIndex(s string, startAt, decodeFrom, runeCount int, ascii bool) int { + if startAt < 0 { + return -1 + } + if startAt < decodeFrom || startAt > len(s) { + return -1 + } + if startAt == decodeFrom { + return 0 + } + if startAt == len(s) { + return runeCount + } + if ascii { + return startAt - decodeFrom + } + rel := startAt - decodeFrom + i := 0 + for strIdx := range s[decodeFrom:] { + if strIdx == rel { + return i + } + if strIdx > rel { + return -1 + } + i++ + } + return -1 +} + +func prevRuneByte(s string, byteIndex int) int { + if byteIndex <= 0 { + return 0 + } + _, size := utf8.DecodeLastRuneInString(s[:byteIndex]) + if size <= 0 { + return byteIndex - 1 + } + return byteIndex - size +} + +func (d decodedInput) release() { + if d.pooled != nil { + *d.pooled = d.runes + pooledRuneBuffers.put(d.pooled) + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go b/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go new file mode 100644 index 00000000..a7b4829a --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go @@ -0,0 +1,75 @@ +package helpers + +import ( + "unicode/utf8" + "unsafe" +) + +const asciiHighBits = 0x8080808080808080 + +// ASCIIScanMin is the input length where a separate ASCII probe plus a tight +// copy beats a single UTF-8 range loop. Short matches stay on the one-pass path. +const ASCIIScanMin = 64 + +// ASCIISearchMin is the haystack length where stdlib/SIMD string search beats +// a scalar first-rune scan. Below this, needle setup and unaligned +// bytes.Index retries dominate. +const ASCIISearchMin = 32 + +// IsASCII reports whether s contains only bytes below utf8.RuneSelf. +func IsASCII(s string) bool { + n := len(s) + if n == 0 { + return true + } + + b := unsafe.Slice(unsafe.StringData(s), n) + i := 0 + for ; i < n && uintptr(unsafe.Pointer(&b[i]))&7 != 0; i++ { + if b[i] >= utf8.RuneSelf { + return false + } + } + for ; i+8 <= n; i += 8 { + v := *(*uint64)(unsafe.Pointer(&b[i])) + if v&asciiHighBits != 0 { + return false + } + } + for ; i < n; i++ { + if b[i] >= utf8.RuneSelf { + return false + } + } + return true +} + +// IsASCIIRunes reports whether every rune in in is an ASCII code point. +func IsASCIIRunes(in []rune) bool { + for _, ch := range in { + if ch >= utf8.RuneSelf { + return false + } + } + return true +} + +// DecodeString writes the runes of s into buf, which must have length >= len(s). +// It returns the rune count and whether s was all ASCII. +func DecodeString(s string, buf []rune) (n int, ascii bool) { + if len(s) >= ASCIIScanMin && IsASCII(s) { + for i := 0; i < len(s); i++ { + buf[i] = rune(s[i]) + } + return len(s), true + } + ascii = true + for _, ch := range s { + if ch >= utf8.RuneSelf { + ascii = false + } + buf[n] = ch + n++ + } + return n, ascii +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go b/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go index 8d24a8c0..14dee3c2 100644 --- a/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go @@ -11,11 +11,30 @@ import ( ) func IndexOfAny(in []rune, find []rune) int { - // special case - if len(find) == 0 { + switch len(find) { + case 0: + return -1 + case 1: + return IndexOfAny1(in, find[0]) + case 2: + return IndexOfAny2(in, find[0], find[1]) + case 3: + return IndexOfAny3(in, find[0], find[1], find[2]) + } + + if IsASCIIRunes(find) { + var bits [2]uint64 + for _, c := range find { + bits[c>>6] |= 1 << (c & 63) + } + for i, c := range in { + if uint32(c) < 128 && bits[c>>6]&(1<<(c&63)) != 0 { + return i + } + } return -1 } - // naive version + for i, c := range in { if slices.Contains(find, c) { return i @@ -25,8 +44,10 @@ func IndexOfAny(in []rune, find []rune) int { } func IndexOfAny1(in []rune, find rune) int { - //TODO: bytes optimization? - return slices.Index(in, find) + if len(in) < ASCIISearchMin { + return slices.Index(in, find) + } + return indexOfRuneBytes(runeSliceBytes(in), find) } func IndexOfAny2(in []rune, find1, find2 rune) int { @@ -125,28 +146,34 @@ func IndexFunc(in []rune, f func(ch rune) bool) int { } func IndexOfAnyExceptInSet(in []rune, set syntax.CharSet) int { - //TODO: this - panic("not implemented") + for i, c := range in { + if !set.CharIn(c) { + return i + } + } + return -1 } func LastIndexOf(in []rune, find []rune) int { - end := len(in) - len(find) - first := find[0] - lastOffset := len(find) - 1 - last := find[lastOffset] - for i := end; i >= 0; i-- { - //TODO: check 2 chars needed? - // match start and end...check the middle - if in[i] == first && in[i+lastOffset] == last { - // found our first char - // check if the rest are equal - if bytesEqual(in[i:i+len(find)], find) { - return i - } + if len(find) == 0 { + return len(in) + } + if len(in) < len(find) { + return -1 + } + haystack := runeSliceBytes(in) + needle := runeSliceBytes(find) + end := len(haystack) + for end >= len(needle) { + idx := bytes.LastIndex(haystack[:end], needle) + if idx < 0 { + return -1 } + if idx%4 == 0 { + return idx / 4 + } + end = idx + len(needle) - 1 } - - //not found return -1 } @@ -160,15 +187,10 @@ func LastIndexOfAnyExcept1(in []rune, not rune) int { } func LastIndexOfAny1(in []rune, find rune) int { - for i := len(in) - 1; i >= 0; i-- { - if in[i] == find { - // found our char - return i - } + if len(in) == 0 { + return -1 } - - //not found - return -1 + return lastIndexOfRuneBytes(runeSliceBytes(in), find) } func LastIndexOfAnyInRange(in []rune, first, last rune) int { @@ -291,30 +313,66 @@ func foldASCII(c rune) rune { } func IndexOf(in []rune, find []rune) int { - /* - Since we auto-gen the find code this shouldn't happen - if len(find) == 0 { - //special case - return -1 - }*/ + if len(find) == 0 { + return 0 + } + if len(in) < len(find) { + return -1 + } end := len(in) - len(find) first := find[0] - //TODO: benchmark checking last char too or first two chars - for i := 0; i <= end; i++ { - // match start...check the rest - if in[i] == first { - // found our first char - // check if the rest are equal - if bytesEqual(in[i:i+len(find)], find) { - return i - } - /*if slices.Equal(in[i:i+len(find)], find) { - return i - }*/ + for i := 0; i <= end; { + off := IndexOfAny1(in[i:end+1], first) + if off < 0 { + return -1 + } + i += off + if bytesEqual(in[i:i+len(find)], find) { + return i } + i++ } + return -1 +} + +func runeSliceBytes(in []rune) []byte { + if len(in) == 0 { + return nil + } + return unsafe.Slice((*byte)(unsafe.Pointer(&in[0])), len(in)*4) +} - //not found +func indexOfRuneBytes(haystack []byte, find rune) int { + needleRune := [1]rune{find} + needle := runeSliceBytes(needleRune[:]) + start := 0 + for { + idx := bytes.Index(haystack[start:], needle) + if idx < 0 { + return -1 + } + idx += start + if idx%4 == 0 { + return idx / 4 + } + start = idx + 1 + } +} + +func lastIndexOfRuneBytes(haystack []byte, find rune) int { + needleRune := [1]rune{find} + needle := runeSliceBytes(needleRune[:]) + end := len(haystack) + for end >= 4 { + idx := bytes.LastIndex(haystack[:end], needle) + if idx < 0 { + return -1 + } + if idx%4 == 0 { + return idx / 4 + } + end = idx + 3 + } return -1 } diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/searchvalues.go b/vendor/github.com/dlclark/regexp2/v2/helpers/searchvalues.go index bafbcfbc..0346d7d4 100644 --- a/vendor/github.com/dlclark/regexp2/v2/helpers/searchvalues.go +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/searchvalues.go @@ -64,14 +64,30 @@ func (s AsciiSearchValues) IndexOfAnyExcept(chars []rune) int { // return the last index of our original vals values within the slice given func (s AsciiSearchValues) LastIndexOfAny(chars []rune) int { - panic("not implemented") - //TODO: this + for i := len(chars) - 1; i >= 0; i-- { + c := chars[i] + if c > unicode.MaxASCII { + continue + } + if s.set[c/64]&(1<<(c%64)) != 0 { + return i + } + } + return -1 } // return the last index of our original vals values within the slice given func (s AsciiSearchValues) LastIndexOfAnyExcept(chars []rune) int { - panic("not implemented") - //TODO: this + for i := len(chars) - 1; i >= 0; i-- { + c := chars[i] + if c > unicode.MaxASCII { + return i + } + if s.set[c/64]&(1<<(c%64)) == 0 { + return i + } + } + return -1 } type RuneSearchValues struct { @@ -79,37 +95,40 @@ type RuneSearchValues struct { } func newRuneSearchValues(vals []rune) RuneSearchValues { - //TODO: pre-calc the stuff we need to make each IndexOf go faster return RuneSearchValues{vals: vals} - } func NewRuneSearchValues(vals string) RuneSearchValues { return newRuneSearchValues([]rune(vals)) } -// return the first index of our original vals values within the slice given func (s RuneSearchValues) IndexOfAny(chars []rune) int { - //naive implementation - //TODO: this return IndexOfAny(chars, s.vals) } -// return the first index of our original vals values within the slice given func (s RuneSearchValues) IndexOfAnyExcept(chars []rune) int { - //TODO: this return IndexOfAnyExcept(chars, s.vals) } -// return the last index of our original vals values within the slice given func (s RuneSearchValues) LastIndexOfAny(chars []rune) int { - panic("not implemented") + if len(s.vals) == 1 { + return LastIndexOfAny1(chars, s.vals[0]) + } + for i := len(chars) - 1; i >= 0; i-- { + if slices.Contains(s.vals, chars[i]) { + return i + } + } + return -1 } -// return the last index of our original vals values within the slice given func (s RuneSearchValues) LastIndexOfAnyExcept(chars []rune) int { - panic("not implemented") - //TODO: this + for i := len(chars) - 1; i >= 0; i-- { + if !slices.Contains(s.vals, chars[i]) { + return i + } + } + return -1 } type StringSearchValues struct { @@ -145,11 +164,21 @@ func NewStringSearchValues(vals [][]rune, ignoreCase bool) StringSearchValues { } func (s StringSearchValues) StartsWith(chars []rune) int { - panic("not implemented") + for _, val := range s.vals { + if StartsWith(chars, val) { + return 0 + } + } + return -1 } func (s StringSearchValues) StartsWithIgnoreCase(chars []rune) int { - panic("not implemented") + for _, val := range s.vals { + if StartsWithIgnoreCase(chars, val) { + return 0 + } + } + return -1 } func (s StringSearchValues) IndexOfAny(in []rune) int { diff --git a/vendor/github.com/dlclark/regexp2/v2/match.go b/vendor/github.com/dlclark/regexp2/v2/match.go index 4003ff0f..ba8a0105 100644 --- a/vendor/github.com/dlclark/regexp2/v2/match.go +++ b/vendor/github.com/dlclark/regexp2/v2/match.go @@ -44,8 +44,9 @@ type Group struct { type Capture struct { // the original string text *matchText - // RuneIndex is the position in the underlying rune slice where the first character of - // captured substring was found. Even if you pass in a string this will be in Runes. + // RuneIndex is the rune index in the original input where the capture starts. + // For string input this counts runes from the start of that string, not of + // any internally sliced decode buffer. RuneIndex int // RuneLength is the number of runes in the captured substring. RuneLength int @@ -55,24 +56,46 @@ type matchText struct { runes []rune input string hasStringInput bool + runeOffset int // original-string rune index of runes[0] + byteOffset int // original-string byte index of runes[0] byteOffsets []int byteOffsetsReady bool } -// String returns the captured text as a String +// String returns the captured text. For string input it is a slice of the +// original haystack: it does not allocate and keeps the original string alive. func (c *Capture) String() string { - return string(c.text.runes[c.RuneIndex : c.RuneIndex+c.RuneLength]) + if c.text == nil { + return "" + } + if c.text.hasStringInput { + start, length := c.ByteRange() + return c.text.input[start : start+length] + } + start := c.runeSliceIndex() + return string(c.text.runes[start : start+c.RuneLength]) } // Runes returns the captured text as a rune slice func (c *Capture) Runes() []rune { - return c.text.runes[c.RuneIndex : c.RuneIndex+c.RuneLength] + if c.text == nil { + return nil + } + start := c.runeSliceIndex() + return c.text.runes[start : start+c.RuneLength] +} + +func (c *Capture) runeSliceIndex() int { + if c.text == nil { + return c.RuneIndex + } + return c.RuneIndex - c.text.runeOffset } // ByteRange returns the UTF-8 byte index and byte length of the captured -// substring. The first call lazily caches byte offsets on shared match text, -// so it is not safe to call concurrently with ByteRange on another capture -// from the same match until the cache has been initialized. +// substring. Matches returned to callers have offsets computed when the match +// is tidied, so concurrent ByteRange/String on captures of the same match is +// then safe. Internal match objects may still initialize the cache on first use. func (c *Capture) ByteRange() (index, length int) { if c.text == nil { return c.RuneIndex, c.RuneLength @@ -85,24 +108,40 @@ func newMatchText(r []rune) *matchText { } func newStringMatchText(input string, r []rune) *matchText { - return &matchText{runes: r, input: input, hasStringInput: true} + return newStringMatchTextAt(input, r, 0, 0) } -func (t *matchText) byteRange(runeIndex, runeLength int) (int, int) { - if !t.byteOffsetsReady { - t.byteOffsets = t.buildByteOffsets() - t.byteOffsetsReady = true +func newStringMatchTextAt(input string, r []rune, runeOffset, byteOffset int) *matchText { + return &matchText{ + runes: r, + input: input, + hasStringInput: true, + runeOffset: runeOffset, + byteOffset: byteOffset, + } +} + +func (t *matchText) ensureByteOffsets() { + if t == nil || t.byteOffsetsReady { + return } + t.byteOffsets = t.buildByteOffsets() + t.byteOffsetsReady = true +} + +func (t *matchText) byteRange(runeIndex, runeLength int) (int, int) { + localRuneIndex := runeIndex - t.runeOffset + t.ensureByteOffsets() if t.byteOffsets == nil { - return runeIndex, runeLength + return t.byteOffset + localRuneIndex, runeLength } - byteIndex := t.byteOffsets[runeIndex] - return byteIndex, t.byteOffsets[runeIndex+runeLength] - byteIndex + byteIndex := t.byteOffsets[localRuneIndex] + return t.byteOffset + byteIndex, t.byteOffsets[localRuneIndex+runeLength] - byteIndex } func (t *matchText) buildByteOffsets() []int { if t.hasStringInput { - return stringByteOffsets(t.input) + return stringByteOffsets(t.input[t.byteOffset:]) } return runeByteOffsets(t.runes) } @@ -199,6 +238,9 @@ func (m *Match) tidy(textpos int) { m.capcount = m.matchcount[0] //copy our root capture to the list m.Captures = []Capture{m.Capture} + if m.text != nil && m.text.hasStringInput { + m.text.ensureByteOffsets() + } if m.balancing { // The idea here is that we want to compact all of our unbalanced captures. To do that we @@ -415,6 +457,9 @@ func newCapture(text *matchText, runeIndex, runeLength int) Capture { } func setCaptureFields(c *Capture, runeIndex, runeLength int) { + if c.text != nil { + runeIndex += c.text.runeOffset + } c.RuneIndex = runeIndex c.RuneLength = runeLength } diff --git a/vendor/github.com/dlclark/regexp2/v2/options.go b/vendor/github.com/dlclark/regexp2/v2/options.go index c0e49fff..e54fa782 100644 --- a/vendor/github.com/dlclark/regexp2/v2/options.go +++ b/vendor/github.com/dlclark/regexp2/v2/options.go @@ -5,6 +5,7 @@ var ( DefaultUnmarshalOptions = None // DefaultOptimizationOptions controls the default memory/performance trade-offs used by Compile. DefaultOptimizationOptions = OptimizationOptions{ + MaxBacktrackingStackSize: 100000, MaxCachedRuneBufferLength: 256 << 10, MaxCachedReplaceBufferLength: 256 << 10, MaxCachedReplacerDataEntries: 16, @@ -36,13 +37,17 @@ const ( Unicode RegexOptions = 0x0400 // "u" ) -// OptimizationOptions controls optional runtime caches and compile-time fast paths. +// OptimizationOptions controls runtime limits, optional caches, and compile-time fast paths. // +// For MaxBacktrackingStackSize, negative values allow unbounded growth. // For replacement data cache size fields, 0 disables persistent retention and // -1 means unbounded. For pooled buffer cache size fields, 0 disables pooling // and -1 allows all built-in size classes. // Defaults are intentionally bounded so Compile is safe for mixed-cardinality inputs. type OptimizationOptions struct { + // MaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. + // Negative values disable the limit. + MaxBacktrackingStackSize int // MaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool. MaxCachedRuneBufferLength int // MaxCachedReplaceBufferLength limits retained replacement output buffers in the shared size-classed pool. @@ -100,6 +105,14 @@ func newCompileConfig(options []CompileOption) compileConfig { return c } +// OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. +// Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit. +func OptionMaxBacktrackingStackSize(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxBacktrackingStackSize = n + }) +} + // OptionMaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool. func OptionMaxCachedRuneBufferLength(n int) CompileOption { return compileOptionFunc(func(c *compileConfig) { diff --git a/vendor/github.com/dlclark/regexp2/v2/regexp.go b/vendor/github.com/dlclark/regexp2/v2/regexp.go index 0a5d140a..c544a572 100644 --- a/vendor/github.com/dlclark/regexp2/v2/regexp.go +++ b/vendor/github.com/dlclark/regexp2/v2/regexp.go @@ -25,6 +25,8 @@ import ( var ( // DefaultMatchTimeout used when running regexp matches -- "forever" DefaultMatchTimeout = time.Duration(math.MaxInt64) + // ErrBacktrackingStackLimit is returned when a match exceeds its configured backtracking stack size. + ErrBacktrackingStackLimit = errors.New("regexp2: maximum backtracking stack size exceeded") ) // Regexp is the representation of a compiled regular expression. @@ -59,7 +61,12 @@ type Regexp struct { // hook points to override runner functions findFirstChar func(r *Runner) bool execute func(r *Runner) error + executeQuick func(r *Runner) error stringPrefixFilter StringPrefixFilter + quickCode *syntax.Code // bool-only program with unobservable captures removed + // leftContextRunes is used when code is nil (registered engines). + // The interpreter reads the same value from code.LeftContextRunes. + leftContextRunes int } // Compile parses a regular expression and returns, if successful, @@ -107,6 +114,7 @@ func compile(expr string, c compileConfig) (*Regexp, error) { capslist: tree.Caplist, capsize: code.Capsize, code: code, + quickCode: makeQuickCode(code), MatchTimeout: DefaultMatchTimeout, optimizations: c.optimizations, } @@ -115,6 +123,18 @@ func compile(expr string, c compileConfig) (*Regexp, error) { return re, nil } +func makeQuickCode(code *syntax.Code) *syntax.Code { + if code == nil || len(code.QuickCodes) == 0 { + return nil + } + quick := *code + quick.Codes = code.QuickCodes + quick.Dispatches = code.QuickDispatches + quick.QuickCodes = nil + quick.QuickDispatches = nil + return &quick +} + // MustCompile is like Compile but panics if the expression cannot be parsed. // It simplifies safe initialization of global variables holding compiled regular // expressions. @@ -225,17 +245,12 @@ func (re *Regexp) FindStringMatch(s string) (*Match, error) { if !ok { return nil, nil } - - r, runeStart := re.getRunesAndStart(s, startAt) - if runeStart < 0 { - runeStart = 0 - } - return re.run(false, runeStart, r, newStringMatchText(s, r)) + return re.findDecodedStringMatch(s, startAt) } // FindRunesMatch searches the input rune slice for a Regexp match func (re *Regexp) FindRunesMatch(r []rune) (*Match, error) { - return re.run(false, -1, r, newMatchText(r)) + return re.run(false, -1, -1, r, newMatchText(r)) } // FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index @@ -247,19 +262,22 @@ func (re *Regexp) FindStringMatchStartingAt(s string, startAt int) (*Match, erro if !ok { return nil, nil } + return re.findDecodedStringMatch(s, startAt) +} - r, startAt := re.getRunesAndStart(s, startAt) - if startAt == -1 { - // we didn't find our start index in the string -- that's a problem - return nil, errors.New("startAt must align to the start of a valid rune in the input string") - } - - return re.run(false, startAt, r, newStringMatchText(s, r)) +func (re *Regexp) findDecodedStringMatch(s string, startAt int) (*Match, error) { + // Returned matches retain their rune data, so this path must not consume a + // pooled buffer that can never be returned. + d := re.decodeStringInput(s, startAt, false) + runner := re.getRunner() + defer re.putRunner(runner) + text := newStringMatchTextAt(s, d.runes, d.runeOffset, d.byteOffset) + return runner.scan(d.runes, text, d.runeStart, -1, false, re.MatchTimeout) } // FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index func (re *Regexp) FindRunesMatchStartingAt(r []rune, startAt int) (*Match, error) { - return re.run(false, startAt, r, newMatchText(r)) + return re.run(false, startAt, -1, r, newMatchText(r)) } // FindAllStringIndex returns a slice of byte index pairs identifying all @@ -277,33 +295,22 @@ func (re *Regexp) FindAllStringIndex(s string, n int) ([][]int, error) { return nil, nil } + d := re.decodeStringInput(s, startAt, true) runner := re.getRunner() - var input []rune - var pooledInput *[]rune - runeStart := 0 - if startAt == 0 { - input, pooledInput = runner.decodeString(s) - } else { - input, runeStart, pooledInput = runner.decodeStringWithStart(s, startAt) - } defer func() { re.putRunner(runner) - if pooledInput != nil { - *pooledInput = input - pooledRuneBuffers.put(pooledInput) - } + d.release() }() - - if runeStart < 0 { - runeStart = 0 - } - byteOffsets := newStringByteMapper(s) - return re.findAllRunesIndex(runner, input, runeStart, n, func(runeIndex, runeLength int) (int, int) { + if re.quickCode != nil { + runner.code = re.quickCode + } + return re.findAllRunesIndex(runner, d.runes, d.runeStart, n, func(runeIndex, runeLength int) (int, int) { if byteOffsets == nil { - return runeIndex, runeIndex + runeLength + return d.byteOffset + runeIndex, d.byteOffset + runeIndex + runeLength } - return byteOffsets.byteIndex(runeIndex), byteOffsets.byteIndex(runeIndex + runeLength) + start := runeIndex + d.runeOffset + return byteOffsets.byteIndex(start), byteOffsets.byteIndex(start + runeLength) }) } @@ -321,6 +328,9 @@ func (re *Regexp) FindAllRunesIndex(r []rune, n int) ([][]int, error) { if re.RightToLeft() { startAt = len(r) } + if re.quickCode != nil { + runner.code = re.quickCode + } return re.findAllRunesIndex(runner, r, startAt, n, func(runeIndex, runeLength int) (int, int) { return runeIndex, runeIndex + runeLength }) @@ -335,8 +345,9 @@ func (re *Regexp) findAllRunesIndex(runner *Runner, input []rune, startAt, n int } prevEnd := -1 + previousMatchLength := -1 for n != 0 { - m, err := runner.scan(input, nil, startAt, true, re.MatchTimeout) + m, err := runner.scan(input, nil, startAt, previousMatchLength, true, re.MatchTimeout) if err != nil { return nil, err } @@ -344,34 +355,19 @@ func (re *Regexp) findAllRunesIndex(runner *Runner, input []rune, startAt, n int break } - if m.RuneLength != 0 || m.RuneIndex != prevEnd { - start, end := makeIndex(m.RuneIndex, m.RuneLength) + localIndex := m.runeSliceIndex() + if m.RuneLength != 0 || localIndex != prevEnd { + start, end := makeIndex(localIndex, m.RuneLength) flat = append(flat, start, end) out = append(out, flat[len(flat)-2:len(flat):len(flat)]) - prevEnd = m.RuneIndex + m.RuneLength + prevEnd = localIndex + m.RuneLength if n > 0 { n-- } } startAt = m.textpos - if m.RuneLength == 0 { - if re.RightToLeft() { - if m.textpos == 0 { - break - } - if startAt == m.textstart { - startAt-- - } - } else { - if m.textpos == len(input) { - break - } - if startAt == m.textstart { - startAt++ - } - } - } + previousMatchLength = m.RuneLength } return out, nil } @@ -420,29 +416,7 @@ func (re *Regexp) FindNextMatch(m *Match) (*Match, error) { return nil, nil } - // If previous match was empty, advance by one before matching to prevent - // infinite loop - startAt := m.textpos - if m.RuneLength == 0 { - if re.RightToLeft() { - if m.textpos == 0 { - return nil, nil - } - if startAt == m.textstart { - startAt-- - } - } else { - if m.textpos == len(m.text.runes) { - return nil, nil - } - - if startAt == m.textstart { - startAt++ - } - - } - } - return re.run(false, startAt, m.text.runes, m.text) + return re.run(false, m.textpos, m.RuneLength, m.text.runes, m.text) } // MatchString return true if the string matches the regex @@ -469,12 +443,16 @@ func (re *Regexp) matchStringAt(s string, startAt int) (bool, error) { var pooledInput *[]rune runeStart := 0 if startAt <= 0 { - input, pooledInput = runner.decodeString(s) + // Common path: decode the whole string without start/offset work. + input, pooledInput = decodeString(s, re.optimizations.MaxCachedRuneBufferLength) if re.RightToLeft() { runeStart = len(input) } } else { - input, runeStart, pooledInput = runner.decodeStringWithStart(s, startAt) + d := decodeInput(s, startAt, re.decodeFrom(s, startAt), re.optimizations.MaxCachedRuneBufferLength, false) + input = d.runes + pooledInput = d.pooled + runeStart = d.runeStart if runeStart < 0 { runeStart = 0 } @@ -486,46 +464,21 @@ func (re *Regexp) matchStringAt(s string, startAt int) (bool, error) { pooledRuneBuffers.put(pooledInput) } }() + if re.quickCode != nil { + runner.code = re.quickCode + } - m, err := runner.scan(input, nil, runeStart, true, re.MatchTimeout) + m, err := runner.scan(input, nil, runeStart, -1, true, re.MatchTimeout) if err != nil { return false, err } return m != nil, nil } -func (re *Regexp) getRunesAndStart(s string, startAt int) ([]rune, int) { - if startAt < 0 { - if re.RightToLeft() { - r := getRunes(s) - return r, len(r) - } - return getRunes(s), 0 - } - ret := make([]rune, len(s)) - i := 0 - runeIdx := -1 - for strIdx, r := range s { - if strIdx == startAt { - runeIdx = i - } - ret[i] = r - i++ - } - if startAt == len(s) { - runeIdx = i - } - return ret[:i], runeIdx -} - -func getRunes(s string) []rune { - return []rune(s) -} - // MatchRunes return true if the runes matches the regex // error will be set if a timeout occurs func (re *Regexp) MatchRunes(r []rune) (bool, error) { - m, err := re.run(true, -1, r, nil) + m, err := re.run(true, -1, -1, r, nil) if err != nil { return false, err } diff --git a/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go b/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go index 41c1aef3..52248772 100644 --- a/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go +++ b/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go @@ -11,13 +11,23 @@ type RuntimeEngineData struct { CapSize int // size of the capture array FindFirstChar func(*Runner) bool // generated candidate search Execute func(*Runner) error - StringPrefixFilter StringPrefixFilter // optional pre-decode candidate search for string input + ExecuteQuick func(*Runner) error // optional bool-only execution with unobservable captures removed + StringPrefixFilter StringPrefixFilter // optional pre-decode candidate search for string input + // LeftContextKnown reports that LeftContextRunes was computed by the + // code generator. If it is false, decoded string input is never sliced; + // older generated engines omit the field and must keep the full string. + LeftContextKnown bool + // LeftContextRunes is how many runes before a candidate start matching + // may inspect. 0 means none, 1 means a single previous rune, and -1 + // means do not slice (lookbehind or \G). Ignored unless LeftContextKnown. + LeftContextRunes int } type cacheKey struct { - pattern string - opt RegexOptions - maintainCaptureOrder bool + pattern string + opt RegexOptions + maintainCaptureOrder bool + maxBacktrackingStackSize int } func RegisterEngine(pattern string, engine RuntimeEngineData, options ...CompileOption) { @@ -28,6 +38,10 @@ func RegisterEngine(pattern string, engine RuntimeEngineData, options ...Compile } func newEngineRegexp(pattern string, c compileConfig, engine RuntimeEngineData) *Regexp { + leftContext := -1 + if engine.LeftContextKnown { + leftContext = engine.LeftContextRunes + } re := &Regexp{ pattern: pattern, options: c.regexOptions, @@ -40,7 +54,9 @@ func newEngineRegexp(pattern string, c compileConfig, engine RuntimeEngineData) optimizations: c.optimizations, findFirstChar: engine.FindFirstChar, execute: engine.Execute, + executeQuick: engine.ExecuteQuick, stringPrefixFilter: engine.StringPrefixFilter, + leftContextRunes: leftContext, } re.initCaches() return re @@ -58,9 +74,10 @@ func getEngineRegexp(pattern string, c compileConfig) *Regexp { func cacheKeyFromConfig(pattern string, c compileConfig) cacheKey { return cacheKey{ - pattern: pattern, - opt: c.regexOptions, - maintainCaptureOrder: c.maintainCaptureOrder, + pattern: pattern, + opt: c.regexOptions, + maintainCaptureOrder: c.maintainCaptureOrder, + maxBacktrackingStackSize: c.optimizations.MaxBacktrackingStackSize, } } diff --git a/vendor/github.com/dlclark/regexp2/v2/replace.go b/vendor/github.com/dlclark/regexp2/v2/replace.go index 240b40f4..48739ab7 100644 --- a/vendor/github.com/dlclark/regexp2/v2/replace.go +++ b/vendor/github.com/dlclark/regexp2/v2/replace.go @@ -87,15 +87,15 @@ func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, } buf := &bytes.Buffer{} - text := m.text.runes if !regex.RightToLeft() { prevat := 0 for m != nil { - if m.RuneIndex != prevat { - buf.WriteString(string(text[prevat:m.RuneIndex])) + start, end := matchInputSpan(m) + if start > prevat { + buf.WriteString(input[prevat:start]) } - prevat = m.RuneIndex + m.RuneLength + prevat = end buf.WriteString(evaluator(*m)) count-- @@ -108,18 +108,19 @@ func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, } } - if prevat < len(text) { - buf.WriteString(string(text[prevat:])) + if prevat < len(input) { + buf.WriteString(input[prevat:]) } } else { - prevat := len(text) + prevat := len(input) var al []string for m != nil { - if m.RuneIndex+m.RuneLength != prevat { - al = append(al, string(text[m.RuneIndex+m.RuneLength:prevat])) + start, end := matchInputSpan(m) + if end < prevat { + al = append(al, input[end:prevat]) } - prevat = m.RuneIndex + prevat = start al = append(al, evaluator(*m)) count-- @@ -133,7 +134,7 @@ func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, } if prevat > 0 { - buf.WriteString(string(text[:prevat])) + buf.WriteString(input[:prevat]) } for i := len(al) - 1; i >= 0; i-- { @@ -144,20 +145,29 @@ func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, return buf.String(), nil } +// matchInputSpan returns the UTF-8 byte range of m in its original string input. +func matchInputSpan(m *Match) (start, end int) { + if m.text != nil && m.text.hasStringInput { + start, length := m.ByteRange() + return start, start + length + } + return m.RuneIndex, m.RuneIndex + m.RuneLength +} + func replaceRunnerLTR(regex *Regexp, data *syntax.ReplacerData, input string, startAt, count int) (string, error) { if startAt > len(input) { return "", errors.New("startAt must be less than the length of the input string") } runner := regex.getRunner() - text, runeStart, pooledText := runner.decodeStringWithStart(input, startAt) + d := decodeInput(input, startAt, 0, regex.optimizations.MaxCachedRuneBufferLength, false) + text := d.runes textInfo := newStringMatchText(input, text) defer func() { regex.putRunner(runner) - if pooledText != nil { - pooledRuneBuffers.put(pooledText) - } + d.release() }() + runeStart := d.runeStart if startAt >= 0 && runeStart < 0 { return "", errors.New("startAt must align to the start of a valid rune in the input string") } @@ -165,7 +175,7 @@ func replaceRunnerLTR(regex *Regexp, data *syntax.ReplacerData, input string, st runeStart = 0 } - m, err := runner.scan(text, textInfo, runeStart, true, regex.MatchTimeout) + m, err := runner.scan(text, textInfo, runeStart, -1, true, regex.MatchTimeout) if err != nil { return "", err } @@ -184,10 +194,11 @@ func replaceRunnerLTR(regex *Regexp, data *syntax.ReplacerData, input string, st compactBalancedMatches(m) } - if m.RuneIndex != prevat { - writeRunes(buf, text, prevat, m.RuneIndex) + local := m.runeSliceIndex() + if local != prevat { + writeRunes(buf, text, prevat, local) } - prevat = m.RuneIndex + m.RuneLength + prevat = local + m.RuneLength replacementImpl(data, buf, m) count-- @@ -195,15 +206,7 @@ func replaceRunnerLTR(regex *Regexp, data *syntax.ReplacerData, input string, st break } - scanStart := m.textpos - if m.RuneLength == 0 { - if scanStart >= len(text) { - break - } - scanStart++ - } - - m, err = runner.scan(text, textInfo, scanStart, true, regex.MatchTimeout) + m, err = runner.scan(text, textInfo, m.textpos, m.RuneLength, true, regex.MatchTimeout) if err != nil { return "", err } @@ -221,14 +224,14 @@ func replaceRunnerRTL(regex *Regexp, data *syntax.ReplacerData, input string, st } runner := regex.getRunner() - text, runeStart, pooledText := runner.decodeStringWithStart(input, startAt) + d := decodeInput(input, startAt, 0, regex.optimizations.MaxCachedRuneBufferLength, false) + text := d.runes textInfo := newStringMatchText(input, text) defer func() { regex.putRunner(runner) - if pooledText != nil { - pooledRuneBuffers.put(pooledText) - } + d.release() }() + runeStart := d.runeStart if startAt >= 0 && runeStart < 0 { return "", errors.New("startAt must align to the start of a valid rune in the input string") } @@ -236,7 +239,7 @@ func replaceRunnerRTL(regex *Regexp, data *syntax.ReplacerData, input string, st runeStart = len(text) } - m, err := runner.scan(text, textInfo, runeStart, true, regex.MatchTimeout) + m, err := runner.scan(text, textInfo, runeStart, -1, true, regex.MatchTimeout) if err != nil { return "", err } @@ -257,10 +260,11 @@ func replaceRunnerRTL(regex *Regexp, data *syntax.ReplacerData, input string, st compactBalancedMatches(m) } - if m.RuneIndex+m.RuneLength != prevat { - al = append(al, string(text[m.RuneIndex+m.RuneLength:prevat])) + local := m.runeSliceIndex() + if local+m.RuneLength != prevat { + al = append(al, string(text[local+m.RuneLength:prevat])) } - prevat = m.RuneIndex + prevat = local replacementImplRTL(data, &al, m) count-- @@ -268,15 +272,7 @@ func replaceRunnerRTL(regex *Regexp, data *syntax.ReplacerData, input string, st break } - scanStart := m.textpos - if m.RuneLength == 0 { - if scanStart <= 0 { - break - } - scanStart-- - } - - m, err = runner.scan(text, textInfo, scanStart, true, regex.MatchTimeout) + m, err = runner.scan(text, textInfo, m.textpos, m.RuneLength, true, regex.MatchTimeout) if err != nil { return "", err } @@ -303,11 +299,12 @@ func replacementImpl(data *syntax.ReplacerData, buf *bytes.Buffer, m *Match) { } else { switch -replaceSpecials - 1 - r { // special insertion patterns case replaceLeftPortion: - for i := 0; i < m.RuneIndex; i++ { + end := m.runeSliceIndex() + for i := 0; i < end; i++ { buf.WriteRune(m.text.runes[i]) } case replaceRightPortion: - for i := m.RuneIndex + m.RuneLength; i < len(m.text.runes); i++ { + for i := m.runeSliceIndex() + m.RuneLength; i < len(m.text.runes); i++ { buf.WriteRune(m.text.runes[i]) } case replaceLastGroup: @@ -335,11 +332,12 @@ func replacementImplRTL(data *syntax.ReplacerData, al *[]string, m *Match) { } else { switch -replaceSpecials - 1 - r { // special insertion patterns case replaceLeftPortion: - for i := 0; i < m.RuneIndex; i++ { + end := m.runeSliceIndex() + for i := 0; i < end; i++ { buf.WriteRune(m.text.runes[i]) } case replaceRightPortion: - for i := m.RuneIndex + m.RuneLength; i < len(m.text.runes); i++ { + for i := m.runeSliceIndex() + m.RuneLength; i < len(m.text.runes); i++ { buf.WriteRune(m.text.runes[i]) } case replaceLastGroup: diff --git a/vendor/github.com/dlclark/regexp2/v2/runner.go b/vendor/github.com/dlclark/regexp2/v2/runner.go index ce09df07..6362cebf 100644 --- a/vendor/github.com/dlclark/regexp2/v2/runner.go +++ b/vendor/github.com/dlclark/regexp2/v2/runner.go @@ -74,8 +74,10 @@ type Runner struct { // // quick is usually false, but can be true to not return matches, just put it in caches. // textstart is -1 to start at the "beginning" (depending on Right-To-Left), otherwise an index in input. +// previousMatchLength is -1 for an initial scan. A zero value advances the current scan position while +// preserving textstart for anchors such as \G. // textInfo is nil for quick scans that do not need returned capture text metadata. -func (re *Regexp) run(quick bool, textstart int, input []rune, textInfo *matchText) (*Match, error) { +func (re *Regexp) run(quick bool, textstart, previousMatchLength int, input []rune, textInfo *matchText) (*Match, error) { // get a cached runner runner := re.getRunner() @@ -88,8 +90,11 @@ func (re *Regexp) run(quick bool, textstart int, input []rune, textInfo *matchTe textstart = 0 } } + if quick && textInfo == nil && re.quickCode != nil { + runner.code = re.quickCode + } - return runner.scan(input, textInfo, textstart, quick, re.MatchTimeout) + return runner.scan(input, textInfo, textstart, previousMatchLength, quick, re.MatchTimeout) } // Scans the string to find the first match. Uses the Match object @@ -108,13 +113,16 @@ func (re *Regexp) run(quick bool, textstart int, input []rune, textInfo *matchTe // used as a boolean result and capture text is intentionally unavailable. If // we collapsed down to just textInfo it would "escape" and hit the GC for fast // scans without captures. -func (r *Runner) scan(rt []rune, textInfo *matchText, textstart int, quick bool, timeout time.Duration) (*Match, error) { +func (r *Runner) scan(rt []rune, textInfo *matchText, textstart, previousMatchLength int, quick bool, timeout time.Duration) (*Match, error) { r.timeout = timeout r.ignoreTimeout = (time.Duration(math.MaxInt64) == timeout) r.debug = r.re.Debug() r.Runtextstart = textstart r.Runtext = rt r.Runtextend = len(rt) + // Some internal callers use quick match tidying while still consuming + // capture data (notably replacement). Capture elision is only safe when no + // match text metadata was requested. stoppos := r.Runtextend bump := 1 @@ -130,6 +138,9 @@ func (r *Runner) scan(rt []rune, textInfo *matchText, textstart int, quick bool, // setup our scanner functions findFirstChar := r.re.findFirstChar execute := r.re.execute + if quick && textInfo == nil && r.re.executeQuick != nil { + execute = r.re.executeQuick + } if findFirstChar == nil { findFirstChar = findFirstCharDefault } @@ -144,6 +155,16 @@ func (r *Runner) scan(rt []rune, textInfo *matchText, textstart int, quick bool, r.initMatch(textInfo) + // An empty previous match must not be returned again. Keep Runtextstart at + // the previous match position for \G, but move the candidate scan position. + if previousMatchLength == 0 { + if r.Runtextpos == stoppos { + r.tidyMatch(true) + return nil, nil + } + r.Runtextpos += bump + } + r.startTimeoutWatch() for { if minRequiredLength > 0 { @@ -208,8 +229,9 @@ func (r *Runner) scan(rt []rune, textInfo *matchText, textstart int, quick bool, func executeDefault(r *Runner) error { - r.goTo(0) - + if err := r.goTo(0); err != nil { + return err + } for { if r.debug { @@ -230,7 +252,59 @@ func executeDefault(r *Runner) error { //noop case syntax.Goto: - r.goTo(r.operand(0)) + if err := r.goTo(r.operand(0)); err != nil { + return err + } + continue + + case syntax.Dispatch: + // Dispatch only peeks at the next rune. It consumes it after finding a + // matching branch, so a failed dispatch leaves the input position alone. + if r.forwardchars() < 1 { + break + } + // Pick the next rune in the current execution direction. + pos := r.Runtextpos + if r.rightToLeft { + pos-- + } + ch := r.Runtext[pos] + tableIndex := r.operand(0) + table := &r.code.Dispatches[tableIndex] + branch := -1 + if ch >= 0 && ch < 128 { + if table.ASCII != nil { + // Larger dispatches use a direct ASCII branch lookup. + branch = int(table.ASCII[ch]) - 1 + } else { + // Smaller dispatches use two compact ASCII bitmasks per set. + word := int(ch >> 6) + bit := uint64(1) << (ch & 63) + for i := range table.Sets { + if table.ASCIIMasks[i*2+word]&bit != 0 { + branch = i + break + } + } + } + } else { + // Non-ASCII runes fall back to the complete character sets. + for i, setIndex := range table.Sets { + if r.code.Sets[setIndex].CharIn(ch) { + branch = i + break + } + } + } + if branch < 0 { + break + } + // The selected branch starts with this rune, so consume it and jump + // directly to the rest of that branch. + r.Runtextpos += r.bump() + if err := r.goTo(table.Branches[branch]); err != nil { + return err + } continue case syntax.Testref: @@ -248,7 +322,9 @@ func executeDefault(r *Runner) error { case syntax.Lazybranch | syntax.Back: r.trackPop() r.textto(r.trackPeek()) - r.goTo(r.operand(0)) + if err := r.goTo(r.operand(0)); err != nil { + return err + } continue case syntax.Setmark: @@ -307,9 +383,11 @@ func executeDefault(r *Runner) error { matched := r.textPos() - r.stackPeek() if matched != 0 { // Nonempty match -> loop now - r.trackPush2(r.stackPeek(), r.textPos()) // Save old mark, textpos - r.stackPush(r.textPos()) // Make new mark - r.goTo(r.operand(0)) // Loop + r.trackPush2(r.stackPeek(), r.textPos()) // Save old mark, textpos + r.stackPush(r.textPos()) // Make new mark + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } } else { // Empty match -> straight now r.trackPushNeg1(r.stackPeek()) // Save old mark r.advance(1) // Straight @@ -364,10 +442,12 @@ func executeDefault(r *Runner) error { r.trackPopN(2) pos := r.trackPeekN(1) - r.trackPushNeg2(r.trackPeek(), 1) // Save old mark, note that we pushed a new mark - r.stackPush(pos) // Make new mark - r.textto(pos) // Recall position - r.goTo(r.operand(0)) // Loop + r.trackPushNeg2(r.trackPeek(), 1) // Save old mark, note that we pushed a new mark + r.stackPush(pos) // Make new mark + r.textto(pos) // Recall position + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } continue case syntax.Lazybranchmark | syntax.Back2: @@ -413,9 +493,11 @@ func executeDefault(r *Runner) error { r.trackPushNeg2(mark, count) // Save old mark, count r.advance(2) // Straight } else { // Nonempty match -> count+loop now - r.trackPush1(mark) // remember mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop + r.trackPush1(mark) // remember mark + r.stackPush2(r.textPos(), count+1) // Make new mark, incr count + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } } continue @@ -452,9 +534,11 @@ func executeDefault(r *Runner) error { count := r.stackPeekN(1) if count < 0 { // Negative count -> loop now - r.trackPushNeg1(mark) // Save old mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop + r.trackPushNeg1(mark) // Save old mark + r.stackPush2(r.textPos(), count+1) // Make new mark, incr count + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } } else { // Nonneg count -> straight now r.trackPush3(mark, count, r.textPos()) // Save mark, count, position r.advance(2) // Straight @@ -472,10 +556,12 @@ func executeDefault(r *Runner) error { textpos := r.trackPeekN(2) if r.trackPeekN(1) < r.operand(1) && textpos != mark { // Under limit and not empty match -> loop - r.textto(textpos) // Recall position - r.stackPush2(textpos, r.trackPeekN(1)+1) // Make new mark, incr count - r.trackPushNeg1(mark) // Save old mark - r.goTo(r.operand(0)) // Loop + r.textto(textpos) // Recall position + r.stackPush2(textpos, r.trackPeekN(1)+1) // Make new mark, incr count + r.trackPushNeg1(mark) // Save old mark + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } continue } else { // Max loops or empty match -> backtrack r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, count @@ -648,6 +734,13 @@ func executeDefault(r *Runner) error { r.advance(1) continue + case syntax.Grapheme: + if !r.TryMatchGrapheme(r.rightToLeft) { + break + } + r.advance(0) + continue + case syntax.Ref: capnum := r.operand(0) @@ -935,18 +1028,21 @@ func executeDefault(r *Runner) error { ; // "break Backward" comes here: - r.backtrack() + if err := r.backtrack(); err != nil { + return err + } } } // increase the size of stack and track storage -func (r *Runner) ensureStorage() { +func (r *Runner) ensureStorage() error { if r.Runstackpos < r.runtrackcount*4 { doubleIntSlice(&r.runstack, &r.Runstackpos) } - if r.Runtrackpos < r.runtrackcount*4 { - doubleIntSlice(&r.runtrack, &r.Runtrackpos) + if r.Runtrackpos < r.runtrackcount*4 && !r.growTrack() { + return ErrBacktrackingStackLimit } + return nil } func (r *Runner) ensureStack(plus int) { @@ -990,14 +1086,17 @@ func (r *Runner) advance(i int) { r.setOperator(r.code.Codes[r.codepos]) } -func (r *Runner) goTo(newpos int) { +func (r *Runner) goTo(newpos int) error { // when branching backward or in place, ensure storage if newpos <= r.codepos { - r.ensureStorage() + if err := r.ensureStorage(); err != nil { + return err + } } r.setOperator(r.code.Codes[newpos]) r.codepos = newpos + return nil } func (r *Runner) textto(newpos int) { @@ -1016,11 +1115,47 @@ func (r *Runner) textPos() int { return r.Runtextpos } +// TryMatchGrapheme consumes one Unicode extended grapheme cluster in the +// runner's current direction. It is exported for regexp2cg-generated engines. +func (r *Runner) TryMatchGrapheme(rightToLeft bool) bool { + var boundary int + if rightToLeft { + boundary = syntax.PreviousGraphemeClusterBoundary(r.Runtext, r.Runtextpos) + } else { + boundary = syntax.NextGraphemeClusterBoundary(r.Runtext, r.Runtextpos) + } + if boundary < 0 { + return false + } + r.Runtextpos = boundary + return true +} + // push onto the backtracking stack func (r *Runner) trackpos() int { return len(r.runtrack) - r.Runtrackpos } +func (r *Runner) growTrack() bool { + oldLen := len(r.runtrack) + newLen := oldLen * 2 + if newLen == 0 { + newLen = 1 + } + if limit := r.re.optimizations.MaxBacktrackingStackSize; limit >= 0 && newLen > limit { + newLen = limit + } + if newLen <= oldLen { + return false + } + + newTrack := make([]int, newLen) + copy(newTrack[newLen-oldLen:], r.runtrack) + r.Runtrackpos += newLen - oldLen + r.runtrack = newTrack + return true +} + func (r *Runner) trackPush() { r.Runtrackpos-- r.runtrack[r.Runtrackpos] = r.codepos @@ -1069,7 +1204,7 @@ func (r *Runner) trackPushNeg2(I1, I2 int) { r.runtrack[r.Runtrackpos] = -r.codepos } -func (r *Runner) backtrack() { +func (r *Runner) backtrack() error { newpos := r.runtrack[r.Runtrackpos] r.Runtrackpos++ @@ -1090,10 +1225,13 @@ func (r *Runner) backtrack() { // When branching backward, ensure storage if newpos < r.codepos { - r.ensureStorage() + if err := r.ensureStorage(); err != nil { + return err + } } r.codepos = newpos + return nil } func (r *Runner) setOperator(op int) { @@ -1397,7 +1535,8 @@ func shouldUseFindFirstCharOptimized(r *Runner) bool { return false } - switch r.code.FindOptimizations.FindMode { + opts := r.code.FindOptimizations + switch opts.FindMode { case syntax.TrailingAnchor_FixedLength_LeftToRight_End, syntax.LeadingString_OrdinalIgnoreCase_LeftToRight, syntax.LeadingStrings_LeftToRight, @@ -1408,6 +1547,13 @@ func shouldUseFindFirstCharOptimized(r *Runner) bool { syntax.LiteralAfterLoop_LeftToRight, syntax.RequiredLandmarkChain_LeftToRight: return true + case syntax.LeadingSet_LeftToRight: + // General Unicode sets already have a direct fallback loop below. + // Large enumerated sets are also faster through the set's ASCII bitmap + // than through the linear IndexOfAny helper. + return len(opts.FixedDistanceSets) > 0 && + ((len(opts.FixedDistanceSets[0].Chars) > 0 && len(opts.FixedDistanceSets[0].Chars) <= 5) || + opts.FixedDistanceSets[0].Range != nil) default: return false } @@ -1429,10 +1575,10 @@ func findFirstCharOptimized(r *Runner) (handled bool, found bool) { case syntax.LeadingString_OrdinalIgnoreCase_LeftToRight: return true, findLeadingStringLeftToRight(r, []rune(opts.LeadingPrefix), true) case syntax.LeadingStrings_LeftToRight: - return true, findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, false) + return true, findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, opts.LeadingPrefixFirstRunes, false) case syntax.LeadingStrings_OrdinalIgnoreCase_LeftToRight: - return true, findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, true) - case syntax.FixedDistanceSets_LeftToRight: + return true, findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, opts.LeadingPrefixFirstRunes, true) + case syntax.LeadingSet_LeftToRight, syntax.FixedDistanceSets_LeftToRight: return true, findFixedDistanceSetsLeftToRight(r, opts.FixedDistanceSets) case syntax.FixedDistanceChar_LeftToRight: return true, findFixedDistanceCharLeftToRight(r, opts.FixedDistanceLiteral.C, opts.FixedDistanceLiteral.Distance) @@ -1487,29 +1633,69 @@ func findLeadingStringLeftToRight(r *Runner, prefix []rune, ignoreCase bool) boo return true } -func findLeadingStringsLeftToRight(r *Runner, prefixes [][]rune, ignoreCase bool) bool { +func findLeadingStringsLeftToRight(r *Runner, prefixes [][]rune, firstRunes []rune, ignoreCase bool) bool { if len(prefixes) == 0 { return false } - for start := r.Runtextpos; start <= latestPossibleStart(r); start++ { - for _, prefix := range prefixes { - if ignoreCase { - if helpers.StartsWithIgnoreCase(r.Runtext[start:], prefix) { + // Unicode ordinal-ignore-case matching has more possible first-rune folds + // than a small precomputed set can safely represent. Keep its conservative + // position-by-position scan; the common case-sensitive path skips directly + // between possible first runes. + if ignoreCase || len(firstRunes) == 0 { + for start := r.Runtextpos; start <= latestPossibleStart(r); start++ { + for _, prefix := range prefixes { + if ignoreCase { + if helpers.StartsWithIgnoreCase(r.Runtext[start:], prefix) { + r.Runtextpos = start + return true + } + } else if helpers.StartsWith(r.Runtext[start:], prefix) { r.Runtextpos = start return true } - } else if helpers.StartsWith(r.Runtext[start:], prefix) { + } + } + r.Runtextpos = r.Runtextend + return false + } + + latest := min(latestPossibleStart(r), r.Runtextend-1) + for searchAt := r.Runtextpos; searchAt <= latest; { + offset := indexOfAnyRunes(r.Runtext[searchAt:latest+1], firstRunes) + if offset < 0 { + break + } + start := searchAt + offset + first := r.Runtext[start] + for _, prefix := range prefixes { + if len(prefix) > 0 && prefix[0] == first && helpers.StartsWith(r.Runtext[start:], prefix) { r.Runtextpos = start return true } } + searchAt = start + 1 } r.Runtextpos = r.Runtextend return false } +func indexOfAnyRunes(input, find []rune) int { + switch len(find) { + case 0: + return -1 + case 1: + return helpers.IndexOfAny1(input, find[0]) + case 2: + return helpers.IndexOfAny2(input, find[0], find[1]) + case 3: + return helpers.IndexOfAny3(input, find[0], find[1], find[2]) + default: + return helpers.IndexOfAny(input, find) + } +} + func findFixedDistanceCharLeftToRight(r *Runner, ch rune, distance int) bool { searchStart := r.Runtextpos + distance for searchStart < r.Runtextend { @@ -1850,6 +2036,9 @@ func (r *Runner) initMatch(textInfo *matchText) { if tracksize < 64 { tracksize = 64 } + if limit := r.re.optimizations.MaxBacktrackingStackSize; limit >= 0 && tracksize > limit { + tracksize = limit + } if stacksize < 32 { stacksize = 32 } @@ -1882,9 +2071,7 @@ func (r *Runner) tidyMatch(quick bool) *Match { m.textpos = r.Runtextpos if m.matchcount[0] > 0 { interval := m.matches[0] - // bytes indices aren't used so just use fast path - m.RuneIndex = interval[0] - m.RuneLength = interval[1] + setCaptureFields(&m.Capture, interval[0], interval[1]) } return m } @@ -2056,36 +2243,6 @@ func (r *Runner) initTrackCount() { } } -// decodeString converts s to []rune using a shared size-classed buffer pool when -// allowed by the regexp optimization settings. Pooled slices must be returned -// after the runner is done with them. -func (r *Runner) decodeString(s string) ([]rune, *[]rune) { - buf, pooled := pooledRuneBuffers.get(len(s), r.re.optimizations.MaxCachedRuneBufferLength) - n := 0 - for _, ch := range s { - buf[n] = ch - n++ - } - return buf[:n], pooled -} - -func (r *Runner) decodeStringWithStart(s string, startAt int) (runes []rune, runeStart int, pooled *[]rune) { - buf, pooled := pooledRuneBuffers.get(len(s), r.re.optimizations.MaxCachedRuneBufferLength) - n := 0 - runeStart = -1 - for strIdx, ch := range s { - if startAt >= 0 && strIdx == startAt { - runeStart = n - } - buf[n] = ch - n++ - } - if startAt >= 0 && startAt == len(s) { - runeStart = n - } - return buf[:n], runeStart, pooled -} - // getRunner returns a runner to use for matching re. func (re *Regexp) getRunner() *Runner { if re.runnerPool == nil { @@ -2097,6 +2254,7 @@ func (re *Regexp) getRunner() *Runner { // putRunner returns a runner to the re's pool cache. func (re *Regexp) putRunner(r *Runner) { r.Runtext = nil + r.code = re.code if r.runmatch != nil { r.runmatch.text = nil } @@ -2128,6 +2286,12 @@ func (r *Runner) StackPop() int { return val } +// StackDepth returns the number of integer slots currently used by the +// generated engine's backtracking stack. +func (r *Runner) StackDepth() int { + return len(r.runstack) - r.Runstackpos +} + func (r *Runner) StackPush(val int) { // check if we need to size up stack r.ensureStack(1) diff --git a/vendor/github.com/dlclark/regexp2/v2/split.go b/vendor/github.com/dlclark/regexp2/v2/split.go index 1dbe0dcd..3c161988 100644 --- a/vendor/github.com/dlclark/regexp2/v2/split.go +++ b/vendor/github.com/dlclark/regexp2/v2/split.go @@ -33,21 +33,20 @@ func (re *Regexp) Split(input string, count int) ([]string, error) { // iterate through the matches priorIndex := 0 var retVal []string - var txt []rune + matched := false m, err := re.FindStringMatch(input) for ; m != nil && count > 0; m, err = re.FindNextMatch(m) { - txt = m.text.runes - // if we have an m, we don't have an err - // append our match - retVal = append(retVal, string(txt[priorIndex:m.RuneIndex])) + matched = true + start, end := matchInputSpan(m) + retVal = append(retVal, input[priorIndex:start]) // append any capture groups, skipping group 0 gs := m.Groups() for i := 1; i < len(gs); i++ { retVal = append(retVal, gs[i].String()) } - priorIndex = m.RuneIndex + m.RuneLength + priorIndex = end count-- } @@ -55,13 +54,10 @@ func (re *Regexp) Split(input string, count int) ([]string, error) { return nil, err } - if txt == nil { - // we never matched, return the original string + if !matched { return []string{input}, nil } - // append our remainder - retVal = append(retVal, string(txt[priorIndex:])) - + retVal = append(retVal, input[priorIndex:]) return retVal, nil } diff --git a/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go b/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go index fe9cb6ad..080b8c29 100644 --- a/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go +++ b/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go @@ -39,6 +39,15 @@ func newStringPrefixFilter(code *syntax.Code) StringPrefixFilter { return stringIndexPrefixesFilter(opts.LeadingPrefixes, false, minRequiredLength) case syntax.LeadingStrings_OrdinalIgnoreCase_LeftToRight: return stringIndexPrefixesFilter(opts.LeadingPrefixes, true, minRequiredLength) + case syntax.LeadingSet_LeftToRight: + if len(opts.FixedDistanceSets) == 0 { + return nil + } + set := opts.FixedDistanceSets[0] + if set.Range == nil && (len(set.Chars) == 0 || len(set.Chars) > 5) { + return nil + } + return stringFixedDistanceSetFilter(set, minRequiredLength) case syntax.FixedDistanceChar_LeftToRight: return stringFixedDistanceCharFilter(opts.FixedDistanceLiteral.C, opts.FixedDistanceLiteral.Distance, minRequiredLength) case syntax.FixedDistanceString_LeftToRight: @@ -50,6 +59,87 @@ func newStringPrefixFilter(code *syntax.Code) StringPrefixFilter { } } +type asciiSetStringScanner struct { + chars string + first byte + last byte + useRange bool + distance int +} + +func newASCIISetStringScanner(set syntax.FixedDistanceSet) (asciiSetStringScanner, bool) { + if set.Negated || set.Distance < 0 { + return asciiSetStringScanner{}, false + } + if set.Range != nil { + if set.Range.First < 0 || set.Range.Last > utf8.RuneSelf-1 { + return asciiSetStringScanner{}, false + } + return asciiSetStringScanner{ + first: byte(set.Range.First), + last: byte(set.Range.Last), + useRange: true, + distance: set.Distance, + }, true + } + if len(set.Chars) == 0 { + return asciiSetStringScanner{}, false + } + chars := make([]byte, len(set.Chars)) + for i, ch := range set.Chars { + if ch < 0 || ch > utf8.RuneSelf-1 { + return asciiSetStringScanner{}, false + } + chars[i] = byte(ch) + } + return asciiSetStringScanner{chars: string(chars), distance: set.Distance}, true +} + +func stringFixedDistanceSetFilter(set syntax.FixedDistanceSet, minRequiredLength int) StringPrefixFilter { + scanner, ok := newASCIISetStringScanner(set) + if !ok { + return nil + } + + return func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + for searchAt := startAt; searchAt < len(input); { + offset := scanner.index(input[searchAt:]) + if offset < 0 { + return 0, false + } + setByteIndex := searchAt + offset + candidateByteIndex, valid := stringFixedDistanceCandidateStart(input, startAt, setByteIndex, scanner.distance) + if valid && hasMinRequiredBytes(input, candidateByteIndex, minRequiredLength) { + return candidateByteIndex, true + } + if valid { + return 0, false + } + searchAt = setByteIndex + 1 + } + return 0, false + } +} + +func (s asciiSetStringScanner) index(input string) int { + if !s.useRange { + if len(s.chars) == 1 { + return strings.IndexByte(input, s.chars[0]) + } + return strings.IndexAny(input, s.chars) + } + for i := 0; i < len(input); i++ { + if input[i] >= s.first && input[i] <= s.last { + return i + } + } + return -1 +} + func stringIndexPrefixFilter(prefix string, ignoreCase bool, minRequiredLength int) StringPrefixFilter { if prefix == "" { return nil diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go b/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go index 9dc4b630..b00fc9ad 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go @@ -688,11 +688,6 @@ func canonicalUnicodeCatName(catName string) (string, bool) { return "", false } -func isValidUnicodeCat(catName string) bool { - _, ok := canonicalUnicodeCatName(catName) - return ok -} - func (c *CharSet) addCategory(categoryName string, negate, caseInsensitive bool) { var ok bool categoryName, ok = canonicalUnicodeCatName(categoryName) @@ -719,28 +714,19 @@ func (c *CharSet) addCaseEquivalences() { if c.anything { return } - for i := 0; i < len(c.ranges); i++ { + rangeCount := len(c.ranges) + for i := 0; i < rangeCount; i++ { r := c.ranges[i] - if r.First == r.Last { - equiv := tryFindCaseEquivalences(r.First) + // For a single range that's in the set, adds any additional ranges + // necessary to ensure that lowercase equivalents are also included. + for i := r.First; i <= r.Last; i++ { + equiv := tryFindCaseEquivalences(i) for _, eq := range equiv { - c.addChar(eq) + c.ranges = append(c.ranges, SingleRange{First: eq, Last: eq}) } - } else { - c.addCaseEquivalenceRange(r.First, r.Last) - } - } -} - -// For a single range that's in the set, adds any additional ranges -// necessary to ensure that lowercase equivalents are also included. -func (c *CharSet) addCaseEquivalenceRange(chMin, chMax rune) { - for i := chMin; i <= chMax; i++ { - equiv := tryFindCaseEquivalences(i) - for _, eq := range equiv { - c.addChar(eq) } } + c.canonicalize() } // Performs a fast lookup which determines if a character is involved in case conversion, as well as @@ -1141,7 +1127,7 @@ func (c *CharSet) addLowercaseRange(chMin, chMax rune) { } if chMinT < chMin || chMaxT > chMax { - c.addRange(chMinT, chMaxT) + c.ranges = append(c.ranges, SingleRange{First: chMinT, Last: chMaxT}) } } } diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/code.go b/vendor/github.com/dlclark/regexp2/v2/syntax/code.go index 1df4e45a..69cad966 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/code.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/code.go @@ -91,6 +91,11 @@ const ( Setloopatomic InstOp = 45 // Updates the bumpalong position to the current position. UpdateBumpalong InstOp = 46 + // Matches one Unicode extended grapheme cluster (\X). + Grapheme InstOp = 47 + // Selects and consumes the next character using a disjoint branch table. + // Operand 0 is an index into Code.Dispatches. + Dispatch InstOp = 48 // Modifiers for alternate modes @@ -105,6 +110,7 @@ type Code struct { Codes []int // the code Strings [][]rune // string table Sets []*CharSet //character set table + Dispatches []DispatchTable // shared match tables for deterministic alternations TrackCount int // how many instructions use backtracking Caps map[int]int // mapping of user group numbers -> impl group slots Capsize int // number of impl group slots @@ -113,6 +119,56 @@ type Code struct { Anchors AnchorLoc // the set of zero-length start anchors (RegexFCD.Bol, etc) RightToLeft bool // true if right to left FindOptimizations *FindOptimizations // analyzed candidate search strategy + QuickCodes []int // bool-only code with unobservable captures removed + QuickDispatches []DispatchTable // lightweight tables targeting QuickCodes + CaptureSlotInUse []bool // capture slots observable by the pattern itself during quick matches + // LeftContextRunes is how many runes before a candidate start matching may + // inspect. 0 means none, 1 means a single previous rune (or slack so ^/\A + // do not see the candidate as the origin), and -1 means do not slice + // (lookbehind or \G). + LeftContextRunes int +} + +// DispatchTable maps disjoint character sets to branch indices. Larger tables +// use a direct ASCII lookup, small tables use compact masks, and non-ASCII +// runes inspect the full sets. +type DispatchTable struct { + Sets []int + Branches []int + ASCII *[128]uint16 // entry index + 1; zero means no branch + ASCIIMasks []uint64 // two membership words per branch when ASCII is nil +} + +// captureSlotsInUse returns the capture slots whose values can affect matching. +// Group 0 is always retained as the success marker. Ordinary captures that are +// never referenced by the pattern may be omitted by bool-only matching APIs. +func captureSlotsInUse(codes []int, capsize int) []bool { + inUse := make([]bool, capsize) + if capsize > 0 { + inUse[0] = true + } + for pos := 0; pos < len(codes); { + op := InstOp(codes[pos]) & Mask + switch op { + case Ref, Testref: + capnum := codes[pos+1] + if capnum >= 0 && capnum < len(inUse) { + inUse[capnum] = true + } + case Capturemark: + // Balancing groups both observe and mutate capture state. Keep both + // sides live even if no later backreference refers to them. + if codes[pos+2] != -1 { + for _, capnum := range codes[pos+1 : pos+3] { + if capnum >= 0 && capnum < len(inUse) { + inUse[capnum] = true + } + } + } + } + pos += opcodeSize(op) + } + return inUse } // PrepareCharSetASCIIBitmaps builds bounded ASCII lookup tables for compiled @@ -156,11 +212,11 @@ func opcodeSize(op InstOp) int { switch op { case Nothing, Bol, Eol, Boundary, Nonboundary, ECMABoundary, NonECMABoundary, Beginning, Start, EndZ, - End, Nullmark, Setmark, Getmark, Setjump, Backjump, Forejump, Stop, UpdateBumpalong: + End, Nullmark, Setmark, Getmark, Setjump, Backjump, Forejump, Stop, UpdateBumpalong, Grapheme: return 1 case One, Notone, Multi, Ref, Testref, Goto, Nullcount, Setcount, Lazybranch, Branchmark, Lazybranchmark, - Prune, Set: + Prune, Set, Dispatch: return 2 case Capturemark, Branchcount, Lazybranchcount, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, @@ -187,7 +243,7 @@ var codeStr = []string{ "Prune", "Stop", "ECMABoundary", "NonECMABoundary", "Oneloopatomic", "Notoneloopatomic", "Setloopatomic", - "Bumpalong", + "Bumpalong", "Grapheme", "Dispatch", } func operatorDescription(op InstOp) string { @@ -234,6 +290,16 @@ func (c *Code) OpcodeDescription(offset int) string { buf.WriteString("Set = ") buf.WriteString(c.Sets[c.Codes[offset+1]].String()) + case Dispatch: + tableIndex := c.Codes[offset+1] + fmt.Fprintf(buf, "Table = %d", tableIndex) + if tableIndex >= 0 && tableIndex < len(c.Dispatches) { + table := &c.Dispatches[tableIndex] + for i, setIndex := range table.Sets { + fmt.Fprintf(buf, ", %s -> %d", c.Sets[setIndex].String(), table.Branches[i]) + } + } + case Multi: fmt.Fprintf(buf, "String = %s", string(c.Strings[c.Codes[offset+1]])) diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go b/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go new file mode 100644 index 00000000..c4faf355 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go @@ -0,0 +1,294 @@ +package syntax + +import "unicode" + +type graphemeBreakClass uint8 + +const ( + graphemeOther graphemeBreakClass = iota + graphemeCR + graphemeLF + graphemeControl + graphemeExtend + graphemeZWJ + graphemeRegionalIndicator + graphemePrepend + graphemeSpacingMark + graphemeL + graphemeV + graphemeT + graphemeLV + graphemeLVT +) + +type indicConjunctBreakClass uint8 + +const ( + indicNone indicConjunctBreakClass = iota + indicConsonant + indicExtend + indicLinker +) + +type graphemeProperties struct { + breakClass graphemeBreakClass + indicClass indicConjunctBreakClass + extendedPictographic bool +} + +// NextGraphemeClusterBoundary returns the first extended-grapheme boundary +// after start, or -1 when start is not a valid input position. It implements +// the Unicode 17 rules from UAX #29 with a small state machine, avoiding the +// backtracking and repeated character-class probes of an equivalent regexp. +func NextGraphemeClusterBoundary(text []rune, start int) int { + if start < 0 || start >= len(text) { + return -1 + } + + previous := graphemePropertiesFor(text[start]) + state := graphemeForwardState{} + state.consume(previous) + + for pos := start + 1; pos < len(text); pos++ { + current := graphemePropertiesFor(text[pos]) + if isGraphemeBoundaryForward(previous.breakClass, current, state) { + return pos + } + state.consume(current) + previous = current + } + return len(text) +} + +// PreviousGraphemeClusterBoundary returns the first extended-grapheme boundary +// before end, or -1 when end is not a valid input position. +func PreviousGraphemeClusterBoundary(text []rune, end int) int { + if end <= 0 || end > len(text) { + return -1 + } + for pos := end - 1; pos > 0; pos-- { + if isGraphemeBoundary(text, pos) { + return pos + } + } + return 0 +} + +type graphemeForwardState struct { + regionalIndicatorCount int + extendedPictographicRun bool + zwjAfterPictographic bool + indicConsonantRun bool + indicLinkerSeen bool +} + +func (s *graphemeForwardState) consume(properties graphemeProperties) { + if properties.breakClass == graphemeRegionalIndicator { + s.regionalIndicatorCount++ + } else { + s.regionalIndicatorCount = 0 + } + + if properties.breakClass == graphemeZWJ { + s.zwjAfterPictographic = s.extendedPictographicRun + } else { + s.zwjAfterPictographic = false + } + if properties.extendedPictographic { + s.extendedPictographicRun = true + } else if properties.breakClass != graphemeExtend { + s.extendedPictographicRun = false + } + + switch properties.indicClass { + case indicConsonant: + s.indicConsonantRun = true + s.indicLinkerSeen = false + case indicExtend: + // Extend preserves a preceding consonant/linker run. + case indicLinker: + if s.indicConsonantRun { + s.indicLinkerSeen = true + } + default: + s.indicConsonantRun = false + s.indicLinkerSeen = false + } +} + +func isGraphemeBoundaryForward(previous graphemeBreakClass, current graphemeProperties, state graphemeForwardState) bool { + if previous == graphemeCR && current.breakClass == graphemeLF { // GB3 + return false + } + if isGraphemeControl(previous) || isGraphemeControl(current.breakClass) { // GB4, GB5 + return true + } + if hangulNoBreak(previous, current.breakClass) { // GB6, GB7, GB8 + return false + } + if current.breakClass == graphemeExtend || current.breakClass == graphemeZWJ || current.breakClass == graphemeSpacingMark { // GB9, GB9a + return false + } + if previous == graphemePrepend { // GB9b + return false + } + if current.indicClass == indicConsonant && state.indicConsonantRun && state.indicLinkerSeen { // GB9c + return false + } + if current.extendedPictographic && state.zwjAfterPictographic { // GB11 + return false + } + if previous == graphemeRegionalIndicator && current.breakClass == graphemeRegionalIndicator && state.regionalIndicatorCount%2 == 1 { // GB12, GB13 + return false + } + return true +} + +func isGraphemeBoundary(text []rune, pos int) bool { + previous := graphemePropertiesFor(text[pos-1]) + current := graphemePropertiesFor(text[pos]) + if previous.breakClass == graphemeCR && current.breakClass == graphemeLF { // GB3 + return false + } + if isGraphemeControl(previous.breakClass) || isGraphemeControl(current.breakClass) { // GB4, GB5 + return true + } + if hangulNoBreak(previous.breakClass, current.breakClass) { // GB6, GB7, GB8 + return false + } + if current.breakClass == graphemeExtend || current.breakClass == graphemeZWJ || current.breakClass == graphemeSpacingMark { // GB9, GB9a + return false + } + if previous.breakClass == graphemePrepend { // GB9b + return false + } + if current.indicClass == indicConsonant && hasIndicConjunctBefore(text, pos) { // GB9c + return false + } + if current.extendedPictographic && hasExtendedPictographicZWJBefore(text, pos) { // GB11 + return false + } + if previous.breakClass == graphemeRegionalIndicator && current.breakClass == graphemeRegionalIndicator { // GB12, GB13 + count := 0 + for i := pos - 1; i >= 0 && graphemeClass(text[i]) == graphemeRegionalIndicator; i-- { + count++ + } + return count%2 == 0 + } + return true +} + +func hasIndicConjunctBefore(text []rune, pos int) bool { + linkerSeen := false + for i := pos - 1; i >= 0; i-- { + switch indicClass(text[i]) { + case indicExtend: + continue + case indicLinker: + linkerSeen = true + continue + case indicConsonant: + return linkerSeen + default: + return false + } + } + return false +} + +func hasExtendedPictographicZWJBefore(text []rune, pos int) bool { + i := pos - 1 + if i < 0 || graphemeClass(text[i]) != graphemeZWJ { + return false + } + for i--; i >= 0 && graphemeClass(text[i]) == graphemeExtend; i-- { + } + return i >= 0 && unicode.Is(unicodeAliasExtended_Pictographic, text[i]) +} + +func isGraphemeControl(class graphemeBreakClass) bool { + return class == graphemeCR || class == graphemeLF || class == graphemeControl +} + +func hangulNoBreak(previous, current graphemeBreakClass) bool { + return previous == graphemeL && (current == graphemeL || current == graphemeV || current == graphemeLV || current == graphemeLVT) || + (previous == graphemeLV || previous == graphemeV) && (current == graphemeV || current == graphemeT) || + (previous == graphemeLVT || previous == graphemeT) && current == graphemeT +} + +func indicClass(ch rune) indicConjunctBreakClass { + if ch < 0x300 { + return indicNone + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Consonant, ch) { + return indicConsonant + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Linker, ch) { + return indicLinker + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Extend, ch) { + return indicExtend + } + return indicNone +} + +func graphemePropertiesFor(ch rune) graphemeProperties { + if ch <= unicode.MaxASCII { + return graphemeProperties{breakClass: graphemeClass(ch)} + } + return graphemeProperties{ + breakClass: graphemeClass(ch), + indicClass: indicClass(ch), + extendedPictographic: ch >= 0xA9 && unicode.Is(unicodeAliasExtended_Pictographic, ch), + } +} + +func graphemeClass(ch rune) graphemeBreakClass { + if ch <= unicode.MaxASCII { + switch ch { + case '\r': + return graphemeCR + case '\n': + return graphemeLF + default: + if ch < ' ' || ch == 0x7F { + return graphemeControl + } + return graphemeOther + } + } + if ch == 0x200D { + return graphemeZWJ + } + if ch >= 0x1F1E6 && ch <= 0x1F1FF { + return graphemeRegionalIndicator + } + if ch >= 0xAC00 && ch <= 0xD7A3 { + if (ch-0xAC00)%28 == 0 { + return graphemeLV + } + return graphemeLVT + } + if ch >= 0x1100 && ch <= 0x115F || ch >= 0xA960 && ch <= 0xA97C { + return graphemeL + } + if ch >= 0x1160 && ch <= 0x11A7 || ch >= 0xD7B0 && ch <= 0xD7C6 { + return graphemeV + } + if ch >= 0x11A8 && ch <= 0x11FF || ch >= 0xD7CB && ch <= 0xD7FB { + return graphemeT + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Control, ch) { + return graphemeControl + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Extend, ch) { + return graphemeExtend + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Prepend, ch) { + return graphemePrepend + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_SpacingMark, ch) { + return graphemeSpacingMark + } + return graphemeOther +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go b/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go index 0186497a..67d77539 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go @@ -21,10 +21,11 @@ type FindOptimizations struct { LeadingPrefixesRunes [][]rune //LeadingStrings *helpers.StringSearchValues - FixedDistanceLiteral FixedDistanceLiteral - FixedDistanceSets []FixedDistanceSet - LiteralAfterLoop *LiteralAfterLoop - LandmarkChain *RequiredLandmarkChain + FixedDistanceLiteral FixedDistanceLiteral + FixedDistanceSets []FixedDistanceSet + LiteralAfterLoop *LiteralAfterLoop + LandmarkChain *RequiredLandmarkChain + LeadingPrefixFirstRunes []rune } type LiteralAfterLoop struct { @@ -460,19 +461,23 @@ func newFindOptimizationsForNode(root *RegexNode, opt ParseOptions, isLeadingPar // We're now left-to-right only and looking for multiple prefixes and/or sets. - // If there are multiple leading strings, we can search for any of them. - // this works in the interpreter, but we avoid it due to additional cost during construction - + // Multiple leading strings let the finder jump between candidate prefixes. + // Case-sensitive prefixes are cheap to collect and help the interpreter. + // Case-insensitive prefix explosion is still limited to code generation. + if prefixes := findPrefixes(root, false); len(prefixes) > 1 { + f.LeadingPrefixes = prefixes + f.LeadingPrefixesRunes = toRunePrefixes(prefixes) + f.LeadingPrefixFirstRunes = leadingPrefixFirstRunes(f.LeadingPrefixesRunes) + f.FindMode = LeadingStrings_LeftToRight + return f + } if !interpreter { ciPrefixes := findPrefixes(root, true) if len(ciPrefixes) > 1 { f.LeadingPrefixes = ciPrefixes f.LeadingPrefixesRunes = toRunePrefixes(ciPrefixes) + f.LeadingPrefixFirstRunes = leadingPrefixFirstRunes(f.LeadingPrefixesRunes) f.FindMode = LeadingStrings_OrdinalIgnoreCase_LeftToRight - /*SYSTEM_TEXT_REGULAREXPRESSIONS - if usesRfoTryFind { - f.LeadingStrings = helpers.NewSearchValues(f.LeadingPrefixes, true) - }*/ return f } } @@ -515,19 +520,6 @@ func newFindOptimizationsForNode(root *RegexNode, opt ParseOptions, isLeadingPar // In some searches, we may use multiple sets, so we want the subsequent ones to also be the efficiency runners-up. slices.SortFunc(fixedDistanceSets, compareFixedDistanceSetsByQuality) - // If the best fixed-distance set is composed of high-frequency characters, IndexOfAny on - // those characters is likely to match too many positions. Prefer a case-sensitive - // multi-prefix search when one is available. - if !interpreter && !mayContainCaseInsensitiveMatching(root) && hasHighFrequencyChars(fixedDistanceSets[0]) { - caseSensitivePrefixes := findPrefixes(root, false) - if len(caseSensitivePrefixes) > 1 { - f.LeadingPrefixes = caseSensitivePrefixes - f.LeadingPrefixesRunes = toRunePrefixes(caseSensitivePrefixes) - f.FindMode = LeadingStrings_LeftToRight - return f - } - } - // If there is no literal after the loop, use whatever set we got. // If there is a literal after the loop, consider it to be better than a negated set and better than a set with many characters. if literalAfterLoop == nil || (len(fixedDistanceSets[0].Chars) > 0 && !fixedDistanceSets[0].Negated) { @@ -587,6 +579,16 @@ func toRunePrefixes(prefixes []string) [][]rune { return runes } +func leadingPrefixFirstRunes(prefixes [][]rune) []rune { + first := make([]rune, 0, len(prefixes)) + for _, prefix := range prefixes { + if len(prefix) > 0 && !slices.Contains(first, prefix[0]) { + first = append(first, prefix[0]) + } + } + return first +} + func getFindMode(rtl bool, t NodeType) FindNextStartingPositionMode { if rtl { switch t { diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go b/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go index 9e9029a8..0e842828 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go @@ -636,11 +636,16 @@ func (p *parser) scanRegex() (*RegexNode, error) { } case '\\': + quoted := !p.useOptionE() && p.charsRight() > 0 && p.rightChar(0) == 'Q' n, err := p.scanBackslash(false) if err != nil { return nil, err } - p.addUnitNode(n) + if quoted { + p.addQuotedUnit(n) + } else { + p.addUnitNode(n) + } case '^': if p.useOptionM() { @@ -702,7 +707,7 @@ func (p *parser) scanRegex() (*RegexNode, error) { // Handle quantifiers for p.unit != nil { var min, max int - var lazy bool + var lazy, possessive bool switch ch { case '*': @@ -753,18 +758,19 @@ func (p *parser) scanRegex() (*RegexNode, error) { return nil, err } - if p.charsRight() == 0 || p.rightChar(0) != '?' { - lazy = false - } else { + if p.charsRight() > 0 && p.rightChar(0) == '?' { p.moveRight(1) lazy = true + } else if p.charsRight() > 0 && p.rightChar(0) == '+' && !p.useOptionE() { + p.moveRight(1) + possessive = true } if min > max { return nil, p.getErr(ErrInvalidRepeatSize) } - p.addConcatenate3(lazy, min, max) + p.addConcatenate3(lazy, possessive, min, max) } ContinueOuterScan: @@ -1280,6 +1286,37 @@ func (p *parser) scanBackslash(scanOnly bool) (*RegexNode, error) { } switch ch := p.rightChar(0); ch { + case 'Q': + if p.useOptionE() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + quoted := p.scanQuoted() + if scanOnly { + return nil, nil + } + return newRegexNodeStr(NtMulti, p.options&^IgnoreCase, quoted), nil + + case 'R': + if p.useOptionE() || p.useRE2() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + if scanOnly { + return nil, nil + } + return newUnicodeNewlineNode(p.options), nil + + case 'X': + if p.useOptionE() || p.useRE2() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + if scanOnly { + return nil, nil + } + return newRegexNode(NtGrapheme, p.options), nil + case 'b', 'B', 'A', 'G', 'Z', 'z': p.moveRight(1) return newRegexNode(p.typeFromCode(ch), p.options), nil @@ -1354,6 +1391,58 @@ func (p *parser) scanBackslash(scanOnly bool) (*RegexNode, error) { } } +// newUnicodeNewlineNode constructs \R from existing general-purpose nodes. +// Its branches have disjoint starting sets, and the optional LF is atomic, so +// reduction can remove the outer atomic wrapper without changing semantics. +func newUnicodeNewlineNode(options RegexOptions) *RegexNode { + options &^= IgnoreCase + + lead, optional := '\r', '\n' + if options&RightToLeft != 0 { + // Stored concatenations are already in execution order. In RTL, consume + // LF first and then the optional preceding CR. + lead, optional = '\n', '\r' + } + + newlines := &CharSet{} + for _, ch := range []rune{'\n', '\v', '\f', '\u0085', '\u2028', '\u2029'} { + if ch != lead { + newlines.addChar(ch) + } + } + if '\r' != lead { + newlines.addChar('\r') + } + + crlf := newRegexNode(NtConcatenate, options) + crlf.addChild(newRegexNodeCh(NtOne, options, lead)) + crlf.addChild(newRegexNodeCh(NtOne, options, optional).makeQuantifier(false, 0, 1)) + + alternate := newRegexNode(NtAlternate, options) + alternate.addChild(newRegexNodeSet(NtSet, options, newlines)) + alternate.addChild(crlf) + + atomic := newRegexNode(NtAtomic, options) + atomic.addChild(alternate) + return atomic +} + +// scanQuoted scans the literal text after \Q through the next \E, or through +// the end of the pattern when there is no terminator. +func (p *parser) scanQuoted() []rune { + start := p.textpos() + var quoted []rune + for p.charsRight() > 0 { + if p.rightChar(0) == '\\' && p.charsRight() > 1 && p.rightChar(1) == 'E' { + quoted = append(quoted, p.pattern[start:p.textpos()]...) + p.moveRight(2) + return quoted + } + p.moveRight(1) + } + return append(quoted, p.pattern[start:p.textpos()]...) +} + // Scans \-style backreferences and character escapes func (p *parser) scanBasicBackslash(scanOnly bool) (*RegexNode, error) { if p.charsRight() == 0 { @@ -1684,6 +1773,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { inRange := false firstChar := true closed := false + var quoted []rune var cc *CharSet if !scanOnly { @@ -1697,11 +1787,33 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { } } - for ; p.charsRight() > 0; firstChar = false { + for ; p.charsRight() > 0 || len(quoted) > 0; firstChar = false { fTranslatedChar := false - ch = p.moveRightGetChar() + for { + if len(quoted) > 0 { + ch = quoted[0] + quoted = quoted[1:] + fTranslatedChar = true + break + } + ch = p.moveRightGetChar() + if ch == '\\' && !p.useOptionE() && p.charsRight() > 0 && p.rightChar(0) == 'Q' { + p.moveRight(1) + quoted = p.scanQuoted() + if len(quoted) == 0 { + if p.charsRight() == 0 { + break + } + continue + } + continue + } + break + } if ch == ']' { - if !firstChar { + if fTranslatedChar { + // A quoted closing bracket is an ordinary class member. + } else if !firstChar { closed = true break } else if p.useOptionE() { @@ -1712,7 +1824,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { break } - } else if ch == '\\' && p.charsRight() > 0 { + } else if ch == '\\' && !fTranslatedChar && p.charsRight() > 0 { switch ch = p.moveRightGetChar(); ch { case 'D', 'd': if !scanOnly { @@ -1815,7 +1927,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { } fTranslatedChar = true } - } else if ch == '[' { + } else if ch == '[' && !fTranslatedChar { // This is code for Posix style properties - [:Ll:] or [:IsTibetan:]. // It currently doesn't do anything other than skip the whole thing! if p.charsRight() > 0 && p.rightChar(0) == ':' && !inRange { @@ -2291,11 +2403,54 @@ func (p *parser) addConcatenate() { } // Finish the current quantifiable (when a quantifier is found) -func (p *parser) addConcatenate3(lazy bool, min, max int) { - p.concatenation.addChild(p.unit.makeQuantifier(lazy, min, max)) +func (p *parser) addConcatenate3(lazy, possessive bool, min, max int) { + node := p.unit.makeQuantifier(lazy, min, max) + if possessive { + atomic := newRegexNode(NtAtomic, p.options) + atomic.addChild(node) + node = atomic + } + p.concatenation.addChild(node) p.unit = nil } +// addQuotedUnit adds the literal characters scanned by \Q...\E. All but the +// final character are completed immediately so a following quantifier applies +// to the final literal character, just as if each character had been escaped. +func (p *parser) addQuotedUnit(node *RegexNode) { + quoted := node.Str + if len(quoted) == 0 { + p.restoreLastUnit() + if p.unit == nil { + p.unit = newRegexNode(NtEmpty, p.options) + } + return + } + for _, ch := range quoted[:len(quoted)-1] { + p.concatenation.addChild(newRegexNodeCh(NtOne, p.options, ch)) + } + p.unit = newRegexNodeCh(NtOne, p.options, quoted[len(quoted)-1]) +} + +// restoreLastUnit makes an immediately preceding literal quantifiable again +// when an empty \Q\E appears between it and its quantifier. +func (p *parser) restoreLastUnit() { + if len(p.concatenation.Children) == 0 { + return + } + last := len(p.concatenation.Children) - 1 + node := p.concatenation.Children[last] + p.concatenation.Children = p.concatenation.Children[:last] + node.Parent = nil + if node.T == NtMulti && len(node.Str) > 1 { + prefix := append([]rune(nil), node.Str[:len(node.Str)-1]...) + p.concatenation.addChild(newRegexNodeStr(NtMulti, node.Options, prefix)) + p.unit = newRegexNodeCh(NtOne, p.options, node.Str[len(node.Str)-1]) + return + } + p.unit = node +} + // Sets the current unit to a single char node func (p *parser) addUnitOne(ch rune) { p.unit = newRegexNodeCh(NtOne, p.options, ch) diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go b/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go index af5a8c06..0f6ad4aa 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go @@ -245,6 +245,9 @@ func (s *regexFcd) calculateFC(nt NodeType, node *RegexNode, CurIndex int) { case NtSetloop, NtSetlazy, NtSetloopatomic: s.pushFC(regexFc{cc: node.Set.Copy(), nullable: node.M == 0, caseInsensitive: ci}) + case NtGrapheme: + s.pushFC(regexFc{cc: *AnyClass(), nullable: false}) + case NtRef: s.pushFC(regexFc{cc: *AnyClass(), nullable: true, caseInsensitive: false}) diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go b/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go index 0490585b..4c421053 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go @@ -123,6 +123,11 @@ func tryFindFirstCharClass(node *RegexNode, ccIn **CharSet) int { } return 0 + case NtGrapheme: + // Every rune can begin a grapheme, so there is no useful candidate + // restriction to derive. + return 0 + // Zero-width elements. These don't contribute to the starting set, so return null to indicate a caller // should keep looking past them. case NtEmpty, NtNothing, NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, @@ -532,6 +537,9 @@ func findPrefixesCore(node *RegexNode, res *[]*bytes.Buffer, ignoreCase bool) bo // that comprise the set. For case-insensitive, we need the set to be two ASCII letters that case fold to the same thing. // As with One and loops, set loops are handled the same as sets up to the min iteration limit. case NtSet, NtSetloop, NtSetlazy, NtSetloopatomic: + if node.Set == nil || node.Set.IsNegated() { + return false + } setChars := node.Set.GetSetChars(maxPrefixes) @@ -895,10 +903,11 @@ func tryFindRawFixedSets(node *RegexNode, res *[]FixedDistanceSet, distance *int combined[fixedSet.Distance] = v } } else { + setCopy := fixedSet.Set.Copy() combined[fixedSet.Distance] = struct { Set *CharSet Count int - }{Set: fixedSet.Set, Count: 1} + }{Set: &setCopy, Count: 1} } } } @@ -1034,50 +1043,6 @@ func sumFrequencies(chars []rune) float32 { return sum } -func hasHighFrequencyChars(set FixedDistanceSet) bool { - if set.Negated { - return true - } - - // Sets without extracted chars can't be frequency-analyzed. - // Single-char sets use IndexOf, which is a strong filter regardless of frequency. - if len(set.Chars) <= 1 { - return false - } - - totalFrequency := sumFrequencies(set.Chars) - - // If the average frequency of the set's chars exceeds this threshold, the - // characters are common enough that a multi-string search may be a better filter. - const highFrequencyThreshold = 0.6 - return totalFrequency >= highFrequencyThreshold*float32(len(set.Chars)) -} - -func mayContainCaseInsensitiveMatching(node *RegexNode) bool { - if node.Options&IgnoreCase != 0 { - return true - } - - if node.Set != nil { - chars := node.Set.GetSetChars(maxPrefixes) - for _, ch := range chars { - if participatesInCaseConversion(ch) && - slices.Contains(chars, unicode.ToLower(ch)) && - slices.Contains(chars, unicode.ToUpper(ch)) { - return true - } - } - } - - for _, child := range node.Children { - if mayContainCaseInsensitiveMatching(child) { - return true - } - } - - return false -} - // Percent occurrences in source text (100 * char count / total count) var frequency = []float32{ 0.000 /* '\x00' */, 0.000 /* '\x01' */, 0.000 /* '\x02' */, 0.000 /* '\x03' */, 0.000 /* '\x04' */, 0.000 /* '\x05' */, 0.000 /* '\x06' */, 0.000, /* '\x07' */ diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go b/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go index f4b8b6a2..bc754a2a 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go @@ -128,6 +128,8 @@ const ( NtSetloopatomic NodeType = 45 // Updates the bumpalong position to the current position. NtUpdateBumpalong NodeType = 46 + // Matches one Unicode extended grapheme cluster (\X). + NtGrapheme NodeType = 47 ) func newRegexNode(t NodeType, opt RegexOptions) *RegexNode { @@ -693,10 +695,117 @@ func (n *RegexNode) reduceAtomic() *RegexNode { // For everything else, try to reduce ending backtracking of the last contained expression. default: child.eliminateEndingBacktracking() + if child.T == NtAlternate && child.hasDisjointStartingSets() && child.hasOnlyIntrinsicallyAtomicBranches() { + return child + } return atomic } } +// hasDisjointStartingSets reports whether every branch is non-nullable and +// begins with a character set that cannot overlap any other branch. In that +// case, once one branch has matched, no sibling branch could match the same +// starting position. +func (n *RegexNode) hasDisjointStartingSets() bool { + _, ok := n.disjointStartingSets() + return ok +} + +// disjointStartingSets returns the non-nullable first-character set for each +// branch when all of those sets are pairwise disjoint. +func (n *RegexNode) disjointStartingSets() ([]*CharSet, bool) { + sets := make([]*CharSet, 0, len(n.Children)) + for _, branch := range n.Children { + var set *CharSet + if tryFindFirstCharClass(branch, &set) != 1 || set == nil { + return nil, false + } + for _, previous := range sets { + if set.MayOverlap(previous) { + return nil, false + } + } + sets = append(sets, set) + } + return sets, true +} + +// disjointAtomicBranchSets returns the first-character sets when an +// alternation can select a branch without leaving a backtracking choice. +func (n *RegexNode) disjointAtomicBranchSets() ([]*CharSet, bool) { + if n.T != NtAlternate || !n.hasOnlyIntrinsicallyAtomicBranches() { + return nil, false + } + return n.disjointStartingSets() +} + +// dispatchCandidates returns disjoint branch sets and the leading nodes that +// can be folded into a consuming Dispatch instruction. +func (n *RegexNode) dispatchCandidates() ([]*CharSet, []*RegexNode, []bool, bool) { + if len(n.Children) >= 1<<16 { + return nil, nil, nil, false + } + sets, ok := n.disjointAtomicBranchSets() + if !ok { + return nil, nil, nil, false + } + + leaders := make([]*RegexNode, len(n.Children)) + complete := make([]bool, len(n.Children)) + for i := range leaders { + branch := n.Children[i] + leader := branch + if leader.T == NtConcatenate && len(leader.Children) > 0 { + leader = leader.Children[0] + } + switch leader.T { + case NtOne, NtNotone, NtSet, NtMulti: + leaders[i] = leader + default: + return nil, nil, nil, false + } + complete[i] = leader == branch && (leader.T != NtMulti || len(leader.Str) == 1) + } + return sets, leaders, complete, true +} + +func (n *RegexNode) hasOnlyIntrinsicallyAtomicBranches() bool { + for _, branch := range n.Children { + if !branch.isIntrinsicallyAtomic() { + return false + } + } + return true +} + +// isIntrinsicallyAtomic reports whether a successful match of this node has no +// alternative input-consuming path to explore if something later fails. +func (n *RegexNode) isIntrinsicallyAtomic() bool { + switch n.T { + case NtOne, NtNotone, NtSet, NtMulti, NtRef, NtGrapheme, + NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, + NtBeginning, NtStart, NtEndZ, NtEnd, NtNothing, NtEmpty, NtUpdateBumpalong, + NtOneloopatomic, NtNotoneloopatomic, NtSetloopatomic, + NtPosLook, NtNegLook, NtAtomic: + return true + + case NtOneloop, NtNotoneloop, NtSetloop, NtOnelazy, NtNotonelazy, NtSetlazy: + return n.M == n.N + + case NtCapture, NtGroup: + return len(n.Children) == 1 && n.Children[0].isIntrinsicallyAtomic() + + case NtConcatenate: + for _, child := range n.Children { + if !child.isIntrinsicallyAtomic() { + return false + } + } + return true + } + return false +} + func (n *RegexNode) makeLoopAtomic() { switch n.T { @@ -1680,6 +1789,12 @@ func (n *RegexNode) reduceConcatenationWithAdjacentStrings() { // Nested repeaters just get multiplied with each other if they're not // too lumpy func (n *RegexNode) reduceRep() *RegexNode { + // Repeating a literal empty expression has no observable effect. In addition to + // being unnecessary, retaining the loop would require one backtracking frame per + // mandatory iteration even though no input is consumed. + if len(n.Children) == 1 && n.Children[0].T == NtEmpty { + return n.Children[0] + } u := n t := n.T @@ -1865,7 +1980,7 @@ func (n *RegexNode) makeQuantifier(lazy bool, min, max int) *RegexNode { // If the result is 0, there is no minimum we can enforce. func (n *RegexNode) ComputeMinLength() int { switch n.T { - case NtOne, NtNotone, NtSet: + case NtOne, NtNotone, NtSet, NtGrapheme: // single char return 1 case NtMulti: @@ -1937,6 +2052,8 @@ func (n *RegexNode) computeMaxLength() int { switch n.T { case NtOne, NtNotone, NtSet: return 1 + case NtGrapheme: + return -1 case NtMulti: return len(n.Str) case NtNotonelazy, NtNotoneloop, NtNotoneloopatomic, @@ -2049,6 +2166,7 @@ var typeStr = []string{ "ECMABoundary", "NonECMABoundary", "OneloopAtomic", "NotoneloopAtomic", "SetloopAtomic", "UpdateBumpalong", + "Grapheme", } func (n *RegexNode) Description() string { diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go b/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go index a165b57e..7a231d7b 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go @@ -41,6 +41,9 @@ var unicodeAliasCategories = map[string]*unicode.RangeTable{ "Grapheme_Cluster_Break=T": unicodeAliasGrapheme_Cluster_Break_T, "Grapheme_Cluster_Break=V": unicodeAliasGrapheme_Cluster_Break_V, "Grapheme_Cluster_Break=ZWJ": unicodeAliasGrapheme_Cluster_Break_ZWJ, + "Indic_Conjunct_Break=Consonant": unicodeAliasIndic_Conjunct_Break_Consonant, + "Indic_Conjunct_Break=Extend": unicodeAliasIndic_Conjunct_Break_Extend, + "Indic_Conjunct_Break=Linker": unicodeAliasIndic_Conjunct_Break_Linker, "Math": unicodeAliasMath, "Sentence_Break=ATerm": unicodeAliasSentence_Break_ATerm, "Sentence_Break=CR": unicodeAliasSentence_Break_CR, @@ -90,6 +93,8 @@ var unicodeSupportedPropertyAliases = map[string]string{ "extpict": "Extended_Pictographic", "gcb": "Grapheme_Cluster_Break", "graphemeclusterbreak": "Grapheme_Cluster_Break", + "incb": "Indic_Conjunct_Break", + "indicconjunctbreak": "Indic_Conjunct_Break", "math": "Math", "sb": "Sentence_Break", "sentencebreak": "Sentence_Break", @@ -118,6 +123,11 @@ var unicodeSupportedPropertyValueAliases = map[string]map[string]string{ "v": "V", "zwj": "ZWJ", }, + "Indic_Conjunct_Break": { + "consonant": "Consonant", + "extend": "Extend", + "linker": "Linker", + }, "Sentence_Break": { "at": "ATerm", "aterm": "ATerm", @@ -6056,3 +6066,529 @@ var unicodeAliasWord_Break_ZWJ = &unicode.RangeTable{ {Lo: 0x200D, Hi: 0x200D, Stride: 1}, }, } + +var unicodeAliasIndic_Conjunct_Break_Consonant = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x915, Hi: 0x939, Stride: 1}, + {Lo: 0x958, Hi: 0x95F, Stride: 1}, + {Lo: 0x978, Hi: 0x97F, Stride: 1}, + {Lo: 0x995, Hi: 0x9A8, Stride: 1}, + {Lo: 0x9AA, Hi: 0x9B0, Stride: 1}, + {Lo: 0x9B2, Hi: 0x9B2, Stride: 1}, + {Lo: 0x9B6, Hi: 0x9B9, Stride: 1}, + {Lo: 0x9DC, Hi: 0x9DD, Stride: 1}, + {Lo: 0x9DF, Hi: 0x9DF, Stride: 1}, + {Lo: 0x9F0, Hi: 0x9F1, Stride: 1}, + {Lo: 0xA95, Hi: 0xAA8, Stride: 1}, + {Lo: 0xAAA, Hi: 0xAB0, Stride: 1}, + {Lo: 0xAB2, Hi: 0xAB3, Stride: 1}, + {Lo: 0xAB5, Hi: 0xAB9, Stride: 1}, + {Lo: 0xAF9, Hi: 0xAF9, Stride: 1}, + {Lo: 0xB15, Hi: 0xB28, Stride: 1}, + {Lo: 0xB2A, Hi: 0xB30, Stride: 1}, + {Lo: 0xB32, Hi: 0xB33, Stride: 1}, + {Lo: 0xB35, Hi: 0xB39, Stride: 1}, + {Lo: 0xB5C, Hi: 0xB5D, Stride: 1}, + {Lo: 0xB5F, Hi: 0xB5F, Stride: 1}, + {Lo: 0xB71, Hi: 0xB71, Stride: 1}, + {Lo: 0xC15, Hi: 0xC28, Stride: 1}, + {Lo: 0xC2A, Hi: 0xC39, Stride: 1}, + {Lo: 0xC58, Hi: 0xC5A, Stride: 1}, + {Lo: 0xD15, Hi: 0xD3A, Stride: 1}, + {Lo: 0x1000, Hi: 0x102A, Stride: 1}, + {Lo: 0x103F, Hi: 0x103F, Stride: 1}, + {Lo: 0x1050, Hi: 0x1055, Stride: 1}, + {Lo: 0x105A, Hi: 0x105D, Stride: 1}, + {Lo: 0x1061, Hi: 0x1061, Stride: 1}, + {Lo: 0x1065, Hi: 0x1066, Stride: 1}, + {Lo: 0x106E, Hi: 0x1070, Stride: 1}, + {Lo: 0x1075, Hi: 0x1081, Stride: 1}, + {Lo: 0x108E, Hi: 0x108E, Stride: 1}, + {Lo: 0x1780, Hi: 0x17B3, Stride: 1}, + {Lo: 0x1A20, Hi: 0x1A54, Stride: 1}, + {Lo: 0x1B0B, Hi: 0x1B0C, Stride: 1}, + {Lo: 0x1B13, Hi: 0x1B33, Stride: 1}, + {Lo: 0x1B45, Hi: 0x1B4C, Stride: 1}, + {Lo: 0x1B83, Hi: 0x1BA0, Stride: 1}, + {Lo: 0x1BAE, Hi: 0x1BAF, Stride: 1}, + {Lo: 0x1BBB, Hi: 0x1BBD, Stride: 1}, + {Lo: 0xA989, Hi: 0xA98B, Stride: 1}, + {Lo: 0xA98F, Hi: 0xA9B2, Stride: 1}, + {Lo: 0xA9E0, Hi: 0xA9E4, Stride: 1}, + {Lo: 0xA9E7, Hi: 0xA9EF, Stride: 1}, + {Lo: 0xA9FA, Hi: 0xA9FE, Stride: 1}, + {Lo: 0xAA60, Hi: 0xAA6F, Stride: 1}, + {Lo: 0xAA71, Hi: 0xAA73, Stride: 1}, + {Lo: 0xAA7A, Hi: 0xAA7A, Stride: 1}, + {Lo: 0xAA7E, Hi: 0xAA7F, Stride: 1}, + {Lo: 0xAAE0, Hi: 0xAAEA, Stride: 1}, + {Lo: 0xABC0, Hi: 0xABDA, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10A00, Hi: 0x10A00, Stride: 1}, + {Lo: 0x10A10, Hi: 0x10A13, Stride: 1}, + {Lo: 0x10A15, Hi: 0x10A17, Stride: 1}, + {Lo: 0x10A19, Hi: 0x10A35, Stride: 1}, + {Lo: 0x11103, Hi: 0x11126, Stride: 1}, + {Lo: 0x11144, Hi: 0x11144, Stride: 1}, + {Lo: 0x11147, Hi: 0x11147, Stride: 1}, + {Lo: 0x11380, Hi: 0x11389, Stride: 1}, + {Lo: 0x1138B, Hi: 0x1138B, Stride: 1}, + {Lo: 0x1138E, Hi: 0x1138E, Stride: 1}, + {Lo: 0x11390, Hi: 0x113B5, Stride: 1}, + {Lo: 0x11900, Hi: 0x11906, Stride: 1}, + {Lo: 0x11909, Hi: 0x11909, Stride: 1}, + {Lo: 0x1190C, Hi: 0x11913, Stride: 1}, + {Lo: 0x11915, Hi: 0x11916, Stride: 1}, + {Lo: 0x11918, Hi: 0x1192F, Stride: 1}, + {Lo: 0x11A00, Hi: 0x11A00, Stride: 1}, + {Lo: 0x11A0B, Hi: 0x11A32, Stride: 1}, + {Lo: 0x11A50, Hi: 0x11A50, Stride: 1}, + {Lo: 0x11A5C, Hi: 0x11A83, Stride: 1}, + {Lo: 0x11F04, Hi: 0x11F10, Stride: 1}, + {Lo: 0x11F12, Hi: 0x11F33, Stride: 1}, + }, +} + +var unicodeAliasIndic_Conjunct_Break_Extend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x300, Hi: 0x36F, Stride: 1}, + {Lo: 0x483, Hi: 0x487, Stride: 1}, + {Lo: 0x488, Hi: 0x489, Stride: 1}, + {Lo: 0x591, Hi: 0x5BD, Stride: 1}, + {Lo: 0x5BF, Hi: 0x5BF, Stride: 1}, + {Lo: 0x5C1, Hi: 0x5C2, Stride: 1}, + {Lo: 0x5C4, Hi: 0x5C5, Stride: 1}, + {Lo: 0x5C7, Hi: 0x5C7, Stride: 1}, + {Lo: 0x610, Hi: 0x61A, Stride: 1}, + {Lo: 0x64B, Hi: 0x65F, Stride: 1}, + {Lo: 0x670, Hi: 0x670, Stride: 1}, + {Lo: 0x6D6, Hi: 0x6DC, Stride: 1}, + {Lo: 0x6DF, Hi: 0x6E4, Stride: 1}, + {Lo: 0x6E7, Hi: 0x6E8, Stride: 1}, + {Lo: 0x6EA, Hi: 0x6ED, Stride: 1}, + {Lo: 0x711, Hi: 0x711, Stride: 1}, + {Lo: 0x730, Hi: 0x74A, Stride: 1}, + {Lo: 0x7A6, Hi: 0x7B0, Stride: 1}, + {Lo: 0x7EB, Hi: 0x7F3, Stride: 1}, + {Lo: 0x7FD, Hi: 0x7FD, Stride: 1}, + {Lo: 0x816, Hi: 0x819, Stride: 1}, + {Lo: 0x81B, Hi: 0x823, Stride: 1}, + {Lo: 0x825, Hi: 0x827, Stride: 1}, + {Lo: 0x829, Hi: 0x82D, Stride: 1}, + {Lo: 0x859, Hi: 0x85B, Stride: 1}, + {Lo: 0x897, Hi: 0x89F, Stride: 1}, + {Lo: 0x8CA, Hi: 0x8E1, Stride: 1}, + {Lo: 0x8E3, Hi: 0x902, Stride: 1}, + {Lo: 0x93A, Hi: 0x93A, Stride: 1}, + {Lo: 0x93C, Hi: 0x93C, Stride: 1}, + {Lo: 0x941, Hi: 0x948, Stride: 1}, + {Lo: 0x951, Hi: 0x957, Stride: 1}, + {Lo: 0x962, Hi: 0x963, Stride: 1}, + {Lo: 0x981, Hi: 0x981, Stride: 1}, + {Lo: 0x9BC, Hi: 0x9BC, Stride: 1}, + {Lo: 0x9BE, Hi: 0x9BE, Stride: 1}, + {Lo: 0x9C1, Hi: 0x9C4, Stride: 1}, + {Lo: 0x9D7, Hi: 0x9D7, Stride: 1}, + {Lo: 0x9E2, Hi: 0x9E3, Stride: 1}, + {Lo: 0x9FE, Hi: 0x9FE, Stride: 1}, + {Lo: 0xA01, Hi: 0xA02, Stride: 1}, + {Lo: 0xA3C, Hi: 0xA3C, Stride: 1}, + {Lo: 0xA41, Hi: 0xA42, Stride: 1}, + {Lo: 0xA47, Hi: 0xA48, Stride: 1}, + {Lo: 0xA4B, Hi: 0xA4D, Stride: 1}, + {Lo: 0xA51, Hi: 0xA51, Stride: 1}, + {Lo: 0xA70, Hi: 0xA71, Stride: 1}, + {Lo: 0xA75, Hi: 0xA75, Stride: 1}, + {Lo: 0xA81, Hi: 0xA82, Stride: 1}, + {Lo: 0xABC, Hi: 0xABC, Stride: 1}, + {Lo: 0xAC1, Hi: 0xAC5, Stride: 1}, + {Lo: 0xAC7, Hi: 0xAC8, Stride: 1}, + {Lo: 0xAE2, Hi: 0xAE3, Stride: 1}, + {Lo: 0xAFA, Hi: 0xAFF, Stride: 1}, + {Lo: 0xB01, Hi: 0xB01, Stride: 1}, + {Lo: 0xB3C, Hi: 0xB3C, Stride: 1}, + {Lo: 0xB3E, Hi: 0xB3E, Stride: 1}, + {Lo: 0xB3F, Hi: 0xB3F, Stride: 1}, + {Lo: 0xB41, Hi: 0xB44, Stride: 1}, + {Lo: 0xB55, Hi: 0xB56, Stride: 1}, + {Lo: 0xB57, Hi: 0xB57, Stride: 1}, + {Lo: 0xB62, Hi: 0xB63, Stride: 1}, + {Lo: 0xB82, Hi: 0xB82, Stride: 1}, + {Lo: 0xBBE, Hi: 0xBBE, Stride: 1}, + {Lo: 0xBC0, Hi: 0xBC0, Stride: 1}, + {Lo: 0xBCD, Hi: 0xBCD, Stride: 1}, + {Lo: 0xBD7, Hi: 0xBD7, Stride: 1}, + {Lo: 0xC00, Hi: 0xC00, Stride: 1}, + {Lo: 0xC04, Hi: 0xC04, Stride: 1}, + {Lo: 0xC3C, Hi: 0xC3C, Stride: 1}, + {Lo: 0xC3E, Hi: 0xC40, Stride: 1}, + {Lo: 0xC46, Hi: 0xC48, Stride: 1}, + {Lo: 0xC4A, Hi: 0xC4C, Stride: 1}, + {Lo: 0xC55, Hi: 0xC56, Stride: 1}, + {Lo: 0xC62, Hi: 0xC63, Stride: 1}, + {Lo: 0xC81, Hi: 0xC81, Stride: 1}, + {Lo: 0xCBC, Hi: 0xCBC, Stride: 1}, + {Lo: 0xCBF, Hi: 0xCBF, Stride: 1}, + {Lo: 0xCC0, Hi: 0xCC0, Stride: 1}, + {Lo: 0xCC2, Hi: 0xCC2, Stride: 1}, + {Lo: 0xCC6, Hi: 0xCC6, Stride: 1}, + {Lo: 0xCC7, Hi: 0xCC8, Stride: 1}, + {Lo: 0xCCA, Hi: 0xCCB, Stride: 1}, + {Lo: 0xCCC, Hi: 0xCCD, Stride: 1}, + {Lo: 0xCD5, Hi: 0xCD6, Stride: 1}, + {Lo: 0xCE2, Hi: 0xCE3, Stride: 1}, + {Lo: 0xD00, Hi: 0xD01, Stride: 1}, + {Lo: 0xD3B, Hi: 0xD3C, Stride: 1}, + {Lo: 0xD3E, Hi: 0xD3E, Stride: 1}, + {Lo: 0xD41, Hi: 0xD44, Stride: 1}, + {Lo: 0xD57, Hi: 0xD57, Stride: 1}, + {Lo: 0xD62, Hi: 0xD63, Stride: 1}, + {Lo: 0xD81, Hi: 0xD81, Stride: 1}, + {Lo: 0xDCA, Hi: 0xDCA, Stride: 1}, + {Lo: 0xDCF, Hi: 0xDCF, Stride: 1}, + {Lo: 0xDD2, Hi: 0xDD4, Stride: 1}, + {Lo: 0xDD6, Hi: 0xDD6, Stride: 1}, + {Lo: 0xDDF, Hi: 0xDDF, Stride: 1}, + {Lo: 0xE31, Hi: 0xE31, Stride: 1}, + {Lo: 0xE34, Hi: 0xE3A, Stride: 1}, + {Lo: 0xE47, Hi: 0xE4E, Stride: 1}, + {Lo: 0xEB1, Hi: 0xEB1, Stride: 1}, + {Lo: 0xEB4, Hi: 0xEBC, Stride: 1}, + {Lo: 0xEC8, Hi: 0xECE, Stride: 1}, + {Lo: 0xF18, Hi: 0xF19, Stride: 1}, + {Lo: 0xF35, Hi: 0xF35, Stride: 1}, + {Lo: 0xF37, Hi: 0xF37, Stride: 1}, + {Lo: 0xF39, Hi: 0xF39, Stride: 1}, + {Lo: 0xF71, Hi: 0xF7E, Stride: 1}, + {Lo: 0xF80, Hi: 0xF84, Stride: 1}, + {Lo: 0xF86, Hi: 0xF87, Stride: 1}, + {Lo: 0xF8D, Hi: 0xF97, Stride: 1}, + {Lo: 0xF99, Hi: 0xFBC, Stride: 1}, + {Lo: 0xFC6, Hi: 0xFC6, Stride: 1}, + {Lo: 0x102D, Hi: 0x1030, Stride: 1}, + {Lo: 0x1032, Hi: 0x1037, Stride: 1}, + {Lo: 0x103A, Hi: 0x103A, Stride: 1}, + {Lo: 0x103D, Hi: 0x103E, Stride: 1}, + {Lo: 0x1058, Hi: 0x1059, Stride: 1}, + {Lo: 0x105E, Hi: 0x1060, Stride: 1}, + {Lo: 0x1071, Hi: 0x1074, Stride: 1}, + {Lo: 0x1082, Hi: 0x1082, Stride: 1}, + {Lo: 0x1085, Hi: 0x1086, Stride: 1}, + {Lo: 0x108D, Hi: 0x108D, Stride: 1}, + {Lo: 0x109D, Hi: 0x109D, Stride: 1}, + {Lo: 0x135D, Hi: 0x135F, Stride: 1}, + {Lo: 0x1712, Hi: 0x1714, Stride: 1}, + {Lo: 0x1715, Hi: 0x1715, Stride: 1}, + {Lo: 0x1732, Hi: 0x1733, Stride: 1}, + {Lo: 0x1734, Hi: 0x1734, Stride: 1}, + {Lo: 0x1752, Hi: 0x1753, Stride: 1}, + {Lo: 0x1772, Hi: 0x1773, Stride: 1}, + {Lo: 0x17B4, Hi: 0x17B5, Stride: 1}, + {Lo: 0x17B7, Hi: 0x17BD, Stride: 1}, + {Lo: 0x17C6, Hi: 0x17C6, Stride: 1}, + {Lo: 0x17C9, Hi: 0x17D1, Stride: 1}, + {Lo: 0x17D3, Hi: 0x17D3, Stride: 1}, + {Lo: 0x17DD, Hi: 0x17DD, Stride: 1}, + {Lo: 0x180B, Hi: 0x180D, Stride: 1}, + {Lo: 0x180F, Hi: 0x180F, Stride: 1}, + {Lo: 0x1885, Hi: 0x1886, Stride: 1}, + {Lo: 0x18A9, Hi: 0x18A9, Stride: 1}, + {Lo: 0x1920, Hi: 0x1922, Stride: 1}, + {Lo: 0x1927, Hi: 0x1928, Stride: 1}, + {Lo: 0x1932, Hi: 0x1932, Stride: 1}, + {Lo: 0x1939, Hi: 0x193B, Stride: 1}, + {Lo: 0x1A17, Hi: 0x1A18, Stride: 1}, + {Lo: 0x1A1B, Hi: 0x1A1B, Stride: 1}, + {Lo: 0x1A56, Hi: 0x1A56, Stride: 1}, + {Lo: 0x1A58, Hi: 0x1A5E, Stride: 1}, + {Lo: 0x1A62, Hi: 0x1A62, Stride: 1}, + {Lo: 0x1A65, Hi: 0x1A6C, Stride: 1}, + {Lo: 0x1A73, Hi: 0x1A7C, Stride: 1}, + {Lo: 0x1A7F, Hi: 0x1A7F, Stride: 1}, + {Lo: 0x1AB0, Hi: 0x1ABD, Stride: 1}, + {Lo: 0x1ABE, Hi: 0x1ABE, Stride: 1}, + {Lo: 0x1ABF, Hi: 0x1ADD, Stride: 1}, + {Lo: 0x1AE0, Hi: 0x1AEB, Stride: 1}, + {Lo: 0x1B00, Hi: 0x1B03, Stride: 1}, + {Lo: 0x1B34, Hi: 0x1B34, Stride: 1}, + {Lo: 0x1B35, Hi: 0x1B35, Stride: 1}, + {Lo: 0x1B36, Hi: 0x1B3A, Stride: 1}, + {Lo: 0x1B3B, Hi: 0x1B3B, Stride: 1}, + {Lo: 0x1B3C, Hi: 0x1B3C, Stride: 1}, + {Lo: 0x1B3D, Hi: 0x1B3D, Stride: 1}, + {Lo: 0x1B42, Hi: 0x1B42, Stride: 1}, + {Lo: 0x1B43, Hi: 0x1B43, Stride: 1}, + {Lo: 0x1B6B, Hi: 0x1B73, Stride: 1}, + {Lo: 0x1B80, Hi: 0x1B81, Stride: 1}, + {Lo: 0x1BA2, Hi: 0x1BA5, Stride: 1}, + {Lo: 0x1BA8, Hi: 0x1BA9, Stride: 1}, + {Lo: 0x1BAA, Hi: 0x1BAA, Stride: 1}, + {Lo: 0x1BAC, Hi: 0x1BAD, Stride: 1}, + {Lo: 0x1BE6, Hi: 0x1BE6, Stride: 1}, + {Lo: 0x1BE8, Hi: 0x1BE9, Stride: 1}, + {Lo: 0x1BED, Hi: 0x1BED, Stride: 1}, + {Lo: 0x1BEF, Hi: 0x1BF1, Stride: 1}, + {Lo: 0x1BF2, Hi: 0x1BF3, Stride: 1}, + {Lo: 0x1C2C, Hi: 0x1C33, Stride: 1}, + {Lo: 0x1C36, Hi: 0x1C37, Stride: 1}, + {Lo: 0x1CD0, Hi: 0x1CD2, Stride: 1}, + {Lo: 0x1CD4, Hi: 0x1CE0, Stride: 1}, + {Lo: 0x1CE2, Hi: 0x1CE8, Stride: 1}, + {Lo: 0x1CED, Hi: 0x1CED, Stride: 1}, + {Lo: 0x1CF4, Hi: 0x1CF4, Stride: 1}, + {Lo: 0x1CF8, Hi: 0x1CF9, Stride: 1}, + {Lo: 0x1DC0, Hi: 0x1DFF, Stride: 1}, + {Lo: 0x200D, Hi: 0x200D, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20DC, Stride: 1}, + {Lo: 0x20DD, Hi: 0x20E0, Stride: 1}, + {Lo: 0x20E1, Hi: 0x20E1, Stride: 1}, + {Lo: 0x20E2, Hi: 0x20E4, Stride: 1}, + {Lo: 0x20E5, Hi: 0x20F0, Stride: 1}, + {Lo: 0x2CEF, Hi: 0x2CF1, Stride: 1}, + {Lo: 0x2D7F, Hi: 0x2D7F, Stride: 1}, + {Lo: 0x2DE0, Hi: 0x2DFF, Stride: 1}, + {Lo: 0x302A, Hi: 0x302D, Stride: 1}, + {Lo: 0x302E, Hi: 0x302F, Stride: 1}, + {Lo: 0x3099, Hi: 0x309A, Stride: 1}, + {Lo: 0xA66F, Hi: 0xA66F, Stride: 1}, + {Lo: 0xA670, Hi: 0xA672, Stride: 1}, + {Lo: 0xA674, Hi: 0xA67D, Stride: 1}, + {Lo: 0xA69E, Hi: 0xA69F, Stride: 1}, + {Lo: 0xA6F0, Hi: 0xA6F1, Stride: 1}, + {Lo: 0xA802, Hi: 0xA802, Stride: 1}, + {Lo: 0xA806, Hi: 0xA806, Stride: 1}, + {Lo: 0xA80B, Hi: 0xA80B, Stride: 1}, + {Lo: 0xA825, Hi: 0xA826, Stride: 1}, + {Lo: 0xA82C, Hi: 0xA82C, Stride: 1}, + {Lo: 0xA8C4, Hi: 0xA8C5, Stride: 1}, + {Lo: 0xA8E0, Hi: 0xA8F1, Stride: 1}, + {Lo: 0xA8FF, Hi: 0xA8FF, Stride: 1}, + {Lo: 0xA926, Hi: 0xA92D, Stride: 1}, + {Lo: 0xA947, Hi: 0xA951, Stride: 1}, + {Lo: 0xA953, Hi: 0xA953, Stride: 1}, + {Lo: 0xA980, Hi: 0xA982, Stride: 1}, + {Lo: 0xA9B3, Hi: 0xA9B3, Stride: 1}, + {Lo: 0xA9B6, Hi: 0xA9B9, Stride: 1}, + {Lo: 0xA9BC, Hi: 0xA9BD, Stride: 1}, + {Lo: 0xA9E5, Hi: 0xA9E5, Stride: 1}, + {Lo: 0xAA29, Hi: 0xAA2E, Stride: 1}, + {Lo: 0xAA31, Hi: 0xAA32, Stride: 1}, + {Lo: 0xAA35, Hi: 0xAA36, Stride: 1}, + {Lo: 0xAA43, Hi: 0xAA43, Stride: 1}, + {Lo: 0xAA4C, Hi: 0xAA4C, Stride: 1}, + {Lo: 0xAA7C, Hi: 0xAA7C, Stride: 1}, + {Lo: 0xAAB0, Hi: 0xAAB0, Stride: 1}, + {Lo: 0xAAB2, Hi: 0xAAB4, Stride: 1}, + {Lo: 0xAAB7, Hi: 0xAAB8, Stride: 1}, + {Lo: 0xAABE, Hi: 0xAABF, Stride: 1}, + {Lo: 0xAAC1, Hi: 0xAAC1, Stride: 1}, + {Lo: 0xAAEC, Hi: 0xAAED, Stride: 1}, + {Lo: 0xABE5, Hi: 0xABE5, Stride: 1}, + {Lo: 0xABE8, Hi: 0xABE8, Stride: 1}, + {Lo: 0xABED, Hi: 0xABED, Stride: 1}, + {Lo: 0xFB1E, Hi: 0xFB1E, Stride: 1}, + {Lo: 0xFE00, Hi: 0xFE0F, Stride: 1}, + {Lo: 0xFE20, Hi: 0xFE2F, Stride: 1}, + {Lo: 0xFF9E, Hi: 0xFF9F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x101FD, Hi: 0x101FD, Stride: 1}, + {Lo: 0x102E0, Hi: 0x102E0, Stride: 1}, + {Lo: 0x10376, Hi: 0x1037A, Stride: 1}, + {Lo: 0x10A01, Hi: 0x10A03, Stride: 1}, + {Lo: 0x10A05, Hi: 0x10A06, Stride: 1}, + {Lo: 0x10A0C, Hi: 0x10A0F, Stride: 1}, + {Lo: 0x10A38, Hi: 0x10A3A, Stride: 1}, + {Lo: 0x10AE5, Hi: 0x10AE6, Stride: 1}, + {Lo: 0x10D24, Hi: 0x10D27, Stride: 1}, + {Lo: 0x10D69, Hi: 0x10D6D, Stride: 1}, + {Lo: 0x10EAB, Hi: 0x10EAC, Stride: 1}, + {Lo: 0x10EFA, Hi: 0x10EFF, Stride: 1}, + {Lo: 0x10F46, Hi: 0x10F50, Stride: 1}, + {Lo: 0x10F82, Hi: 0x10F85, Stride: 1}, + {Lo: 0x11001, Hi: 0x11001, Stride: 1}, + {Lo: 0x11038, Hi: 0x11046, Stride: 1}, + {Lo: 0x11070, Hi: 0x11070, Stride: 1}, + {Lo: 0x11073, Hi: 0x11074, Stride: 1}, + {Lo: 0x1107F, Hi: 0x11081, Stride: 1}, + {Lo: 0x110B3, Hi: 0x110B6, Stride: 1}, + {Lo: 0x110B9, Hi: 0x110BA, Stride: 1}, + {Lo: 0x110C2, Hi: 0x110C2, Stride: 1}, + {Lo: 0x11100, Hi: 0x11102, Stride: 1}, + {Lo: 0x11127, Hi: 0x1112B, Stride: 1}, + {Lo: 0x1112D, Hi: 0x11132, Stride: 1}, + {Lo: 0x11134, Hi: 0x11134, Stride: 1}, + {Lo: 0x11173, Hi: 0x11173, Stride: 1}, + {Lo: 0x11180, Hi: 0x11181, Stride: 1}, + {Lo: 0x111B6, Hi: 0x111BE, Stride: 1}, + {Lo: 0x111C0, Hi: 0x111C0, Stride: 1}, + {Lo: 0x111C9, Hi: 0x111CC, Stride: 1}, + {Lo: 0x111CF, Hi: 0x111CF, Stride: 1}, + {Lo: 0x1122F, Hi: 0x11231, Stride: 1}, + {Lo: 0x11234, Hi: 0x11234, Stride: 1}, + {Lo: 0x11235, Hi: 0x11235, Stride: 1}, + {Lo: 0x11236, Hi: 0x11237, Stride: 1}, + {Lo: 0x1123E, Hi: 0x1123E, Stride: 1}, + {Lo: 0x11241, Hi: 0x11241, Stride: 1}, + {Lo: 0x112DF, Hi: 0x112DF, Stride: 1}, + {Lo: 0x112E3, Hi: 0x112EA, Stride: 1}, + {Lo: 0x11300, Hi: 0x11301, Stride: 1}, + {Lo: 0x1133B, Hi: 0x1133C, Stride: 1}, + {Lo: 0x1133E, Hi: 0x1133E, Stride: 1}, + {Lo: 0x11340, Hi: 0x11340, Stride: 1}, + {Lo: 0x1134D, Hi: 0x1134D, Stride: 1}, + {Lo: 0x11357, Hi: 0x11357, Stride: 1}, + {Lo: 0x11366, Hi: 0x1136C, Stride: 1}, + {Lo: 0x11370, Hi: 0x11374, Stride: 1}, + {Lo: 0x113B8, Hi: 0x113B8, Stride: 1}, + {Lo: 0x113BB, Hi: 0x113C0, Stride: 1}, + {Lo: 0x113C2, Hi: 0x113C2, Stride: 1}, + {Lo: 0x113C5, Hi: 0x113C5, Stride: 1}, + {Lo: 0x113C7, Hi: 0x113C9, Stride: 1}, + {Lo: 0x113CE, Hi: 0x113CE, Stride: 1}, + {Lo: 0x113CF, Hi: 0x113CF, Stride: 1}, + {Lo: 0x113D2, Hi: 0x113D2, Stride: 1}, + {Lo: 0x113E1, Hi: 0x113E2, Stride: 1}, + {Lo: 0x11438, Hi: 0x1143F, Stride: 1}, + {Lo: 0x11442, Hi: 0x11444, Stride: 1}, + {Lo: 0x11446, Hi: 0x11446, Stride: 1}, + {Lo: 0x1145E, Hi: 0x1145E, Stride: 1}, + {Lo: 0x114B0, Hi: 0x114B0, Stride: 1}, + {Lo: 0x114B3, Hi: 0x114B8, Stride: 1}, + {Lo: 0x114BA, Hi: 0x114BA, Stride: 1}, + {Lo: 0x114BD, Hi: 0x114BD, Stride: 1}, + {Lo: 0x114BF, Hi: 0x114C0, Stride: 1}, + {Lo: 0x114C2, Hi: 0x114C3, Stride: 1}, + {Lo: 0x115AF, Hi: 0x115AF, Stride: 1}, + {Lo: 0x115B2, Hi: 0x115B5, Stride: 1}, + {Lo: 0x115BC, Hi: 0x115BD, Stride: 1}, + {Lo: 0x115BF, Hi: 0x115C0, Stride: 1}, + {Lo: 0x115DC, Hi: 0x115DD, Stride: 1}, + {Lo: 0x11633, Hi: 0x1163A, Stride: 1}, + {Lo: 0x1163D, Hi: 0x1163D, Stride: 1}, + {Lo: 0x1163F, Hi: 0x11640, Stride: 1}, + {Lo: 0x116AB, Hi: 0x116AB, Stride: 1}, + {Lo: 0x116AD, Hi: 0x116AD, Stride: 1}, + {Lo: 0x116B0, Hi: 0x116B5, Stride: 1}, + {Lo: 0x116B6, Hi: 0x116B6, Stride: 1}, + {Lo: 0x116B7, Hi: 0x116B7, Stride: 1}, + {Lo: 0x1171D, Hi: 0x1171D, Stride: 1}, + {Lo: 0x1171F, Hi: 0x1171F, Stride: 1}, + {Lo: 0x11722, Hi: 0x11725, Stride: 1}, + {Lo: 0x11727, Hi: 0x1172B, Stride: 1}, + {Lo: 0x1182F, Hi: 0x11837, Stride: 1}, + {Lo: 0x11839, Hi: 0x1183A, Stride: 1}, + {Lo: 0x11930, Hi: 0x11930, Stride: 1}, + {Lo: 0x1193B, Hi: 0x1193C, Stride: 1}, + {Lo: 0x1193D, Hi: 0x1193D, Stride: 1}, + {Lo: 0x11943, Hi: 0x11943, Stride: 1}, + {Lo: 0x119D4, Hi: 0x119D7, Stride: 1}, + {Lo: 0x119DA, Hi: 0x119DB, Stride: 1}, + {Lo: 0x119E0, Hi: 0x119E0, Stride: 1}, + {Lo: 0x11A01, Hi: 0x11A0A, Stride: 1}, + {Lo: 0x11A33, Hi: 0x11A38, Stride: 1}, + {Lo: 0x11A3B, Hi: 0x11A3E, Stride: 1}, + {Lo: 0x11A51, Hi: 0x11A56, Stride: 1}, + {Lo: 0x11A59, Hi: 0x11A5B, Stride: 1}, + {Lo: 0x11A8A, Hi: 0x11A96, Stride: 1}, + {Lo: 0x11A98, Hi: 0x11A98, Stride: 1}, + {Lo: 0x11B60, Hi: 0x11B60, Stride: 1}, + {Lo: 0x11B62, Hi: 0x11B64, Stride: 1}, + {Lo: 0x11B66, Hi: 0x11B66, Stride: 1}, + {Lo: 0x11C30, Hi: 0x11C36, Stride: 1}, + {Lo: 0x11C38, Hi: 0x11C3D, Stride: 1}, + {Lo: 0x11C3F, Hi: 0x11C3F, Stride: 1}, + {Lo: 0x11C92, Hi: 0x11CA7, Stride: 1}, + {Lo: 0x11CAA, Hi: 0x11CB0, Stride: 1}, + {Lo: 0x11CB2, Hi: 0x11CB3, Stride: 1}, + {Lo: 0x11CB5, Hi: 0x11CB6, Stride: 1}, + {Lo: 0x11D31, Hi: 0x11D36, Stride: 1}, + {Lo: 0x11D3A, Hi: 0x11D3A, Stride: 1}, + {Lo: 0x11D3C, Hi: 0x11D3D, Stride: 1}, + {Lo: 0x11D3F, Hi: 0x11D45, Stride: 1}, + {Lo: 0x11D47, Hi: 0x11D47, Stride: 1}, + {Lo: 0x11D90, Hi: 0x11D91, Stride: 1}, + {Lo: 0x11D95, Hi: 0x11D95, Stride: 1}, + {Lo: 0x11D97, Hi: 0x11D97, Stride: 1}, + {Lo: 0x11EF3, Hi: 0x11EF4, Stride: 1}, + {Lo: 0x11F00, Hi: 0x11F01, Stride: 1}, + {Lo: 0x11F36, Hi: 0x11F3A, Stride: 1}, + {Lo: 0x11F40, Hi: 0x11F40, Stride: 1}, + {Lo: 0x11F41, Hi: 0x11F41, Stride: 1}, + {Lo: 0x11F5A, Hi: 0x11F5A, Stride: 1}, + {Lo: 0x13440, Hi: 0x13440, Stride: 1}, + {Lo: 0x13447, Hi: 0x13455, Stride: 1}, + {Lo: 0x1611E, Hi: 0x16129, Stride: 1}, + {Lo: 0x1612D, Hi: 0x1612F, Stride: 1}, + {Lo: 0x16AF0, Hi: 0x16AF4, Stride: 1}, + {Lo: 0x16B30, Hi: 0x16B36, Stride: 1}, + {Lo: 0x16F4F, Hi: 0x16F4F, Stride: 1}, + {Lo: 0x16F8F, Hi: 0x16F92, Stride: 1}, + {Lo: 0x16FE4, Hi: 0x16FE4, Stride: 1}, + {Lo: 0x16FF0, Hi: 0x16FF1, Stride: 1}, + {Lo: 0x1BC9D, Hi: 0x1BC9E, Stride: 1}, + {Lo: 0x1CF00, Hi: 0x1CF2D, Stride: 1}, + {Lo: 0x1CF30, Hi: 0x1CF46, Stride: 1}, + {Lo: 0x1D165, Hi: 0x1D166, Stride: 1}, + {Lo: 0x1D167, Hi: 0x1D169, Stride: 1}, + {Lo: 0x1D16D, Hi: 0x1D172, Stride: 1}, + {Lo: 0x1D17B, Hi: 0x1D182, Stride: 1}, + {Lo: 0x1D185, Hi: 0x1D18B, Stride: 1}, + {Lo: 0x1D1AA, Hi: 0x1D1AD, Stride: 1}, + {Lo: 0x1D242, Hi: 0x1D244, Stride: 1}, + {Lo: 0x1DA00, Hi: 0x1DA36, Stride: 1}, + {Lo: 0x1DA3B, Hi: 0x1DA6C, Stride: 1}, + {Lo: 0x1DA75, Hi: 0x1DA75, Stride: 1}, + {Lo: 0x1DA84, Hi: 0x1DA84, Stride: 1}, + {Lo: 0x1DA9B, Hi: 0x1DA9F, Stride: 1}, + {Lo: 0x1DAA1, Hi: 0x1DAAF, Stride: 1}, + {Lo: 0x1E000, Hi: 0x1E006, Stride: 1}, + {Lo: 0x1E008, Hi: 0x1E018, Stride: 1}, + {Lo: 0x1E01B, Hi: 0x1E021, Stride: 1}, + {Lo: 0x1E023, Hi: 0x1E024, Stride: 1}, + {Lo: 0x1E026, Hi: 0x1E02A, Stride: 1}, + {Lo: 0x1E08F, Hi: 0x1E08F, Stride: 1}, + {Lo: 0x1E130, Hi: 0x1E136, Stride: 1}, + {Lo: 0x1E2AE, Hi: 0x1E2AE, Stride: 1}, + {Lo: 0x1E2EC, Hi: 0x1E2EF, Stride: 1}, + {Lo: 0x1E4EC, Hi: 0x1E4EF, Stride: 1}, + {Lo: 0x1E5EE, Hi: 0x1E5EF, Stride: 1}, + {Lo: 0x1E6E3, Hi: 0x1E6E3, Stride: 1}, + {Lo: 0x1E6E6, Hi: 0x1E6E6, Stride: 1}, + {Lo: 0x1E6EE, Hi: 0x1E6EF, Stride: 1}, + {Lo: 0x1E6F5, Hi: 0x1E6F5, Stride: 1}, + {Lo: 0x1E8D0, Hi: 0x1E8D6, Stride: 1}, + {Lo: 0x1E944, Hi: 0x1E94A, Stride: 1}, + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + {Lo: 0xE0100, Hi: 0xE01EF, Stride: 1}, + }, +} + +var unicodeAliasIndic_Conjunct_Break_Linker = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x94D, Hi: 0x94D, Stride: 1}, + {Lo: 0x9CD, Hi: 0x9CD, Stride: 1}, + {Lo: 0xACD, Hi: 0xACD, Stride: 1}, + {Lo: 0xB4D, Hi: 0xB4D, Stride: 1}, + {Lo: 0xC4D, Hi: 0xC4D, Stride: 1}, + {Lo: 0xD4D, Hi: 0xD4D, Stride: 1}, + {Lo: 0x1039, Hi: 0x1039, Stride: 1}, + {Lo: 0x17D2, Hi: 0x17D2, Stride: 1}, + {Lo: 0x1A60, Hi: 0x1A60, Stride: 1}, + {Lo: 0x1B44, Hi: 0x1B44, Stride: 1}, + {Lo: 0x1BAB, Hi: 0x1BAB, Stride: 1}, + {Lo: 0xA9C0, Hi: 0xA9C0, Stride: 1}, + {Lo: 0xAAF6, Hi: 0xAAF6, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10A3F, Hi: 0x10A3F, Stride: 1}, + {Lo: 0x11133, Hi: 0x11133, Stride: 1}, + {Lo: 0x113D0, Hi: 0x113D0, Stride: 1}, + {Lo: 0x1193E, Hi: 0x1193E, Stride: 1}, + {Lo: 0x11A47, Hi: 0x11A47, Stride: 1}, + {Lo: 0x11A99, Hi: 0x11A99, Stride: 1}, + {Lo: 0x11F42, Hi: 0x11F42, Stride: 1}, + }, +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go b/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go index 818b4b56..ec1818e7 100644 --- a/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go @@ -4,34 +4,93 @@ import ( "bytes" "fmt" "math" + "slices" ) func Write(tree *RegexTree) (*Code, error) { - w := writer{ - intStack: make([]int, 0, 32), - emitted: make([]int, 2), - stringhash: make(map[string]int), - sethash: make(map[string]int), + w := newWriter(nil) + code, err := w.codeFromTree(tree) + if err != nil { + return nil, err } - code, err := w.codeFromTree(tree) + if slices.Contains(code.CaptureSlotInUse, false) { + quickWriter := newWriter(code.CaptureSlotInUse) + quickCode, err := quickWriter.codeFromTree(tree) + if err != nil { + return nil, err + } + if !dispatchTablesEqual(code.Dispatches, quickCode.Dispatches) { + return nil, fmt.Errorf("full and quick dispatch tables differ") + } + for i := range quickCode.Dispatches { + quickCode.Dispatches[i].Sets = code.Dispatches[i].Sets + quickCode.Dispatches[i].ASCII = code.Dispatches[i].ASCII + quickCode.Dispatches[i].ASCIIMasks = code.Dispatches[i].ASCIIMasks + } + code.QuickCodes = quickCode.Codes + code.QuickDispatches = quickCode.Dispatches + } + return code, nil +} - return code, err +func newWriter(quickCaptureSlots []bool) writer { + return writer{ + intStack: make([]int, 0, 32), + emitted: make([]int, 2), + stringhash: make(map[string]int), + sethash: make(map[string]int), + preconsumed: make(map[*RegexNode]bool), + dispatchInfo: make(map[*RegexNode]dispatchInfo), + dispatchCodes: make(map[*RegexNode]int), + dispatchGotos: make(map[*RegexNode][]int), + quickCaptureSlots: quickCaptureSlots, + } } type writer struct { emitted []int - intStack []int - curpos int - stringhash map[string]int - stringtable [][]rune - sethash map[string]int - settable []*CharSet - counting bool - count int - trackcount int - caps map[int]int + intStack []int + curpos int + stringhash map[string]int + stringtable [][]rune + sethash map[string]int + settable []*CharSet + dispatchtable []DispatchTable + preconsumed map[*RegexNode]bool + dispatchInfo map[*RegexNode]dispatchInfo + dispatchCodes map[*RegexNode]int + dispatchGotos map[*RegexNode][]int + counting bool + count int + trackcount int + caps map[int]int + quickCaptureSlots []bool +} + +type dispatchInfo struct { + sets []*CharSet + leaders []*RegexNode + complete []bool + ok bool +} + +func dispatchTablesEqual(left, right []DispatchTable) bool { + if len(left) != len(right) { + return false + } + for i := range left { + if !slices.Equal(left[i].Sets, right[i].Sets) || + !slices.Equal(left[i].ASCIIMasks, right[i].ASCIIMasks) || + (left[i].ASCII == nil) != (right[i].ASCII == nil) { + return false + } + if left[i].ASCII != nil && *left[i].ASCII != *right[i].ASCII { + return false + } + } + return true } const ( @@ -74,6 +133,8 @@ func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { for { if !w.counting { w.emitted = make([]int, w.count) + w.dispatchCodes = make(map[*RegexNode]int) + w.dispatchGotos = make(map[*RegexNode][]int) } curNode = tree.Root @@ -120,6 +181,9 @@ func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { w.counting = false } + if w.quickCaptureSlots != nil { + return &Code{Codes: w.emitted, Dispatches: w.dispatchtable, TrackCount: w.trackcount}, nil + } fcPrefix := getFirstCharsPrefix(tree) prefix := getPrefix(tree) @@ -141,17 +205,57 @@ func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { Codes: w.emitted, Strings: w.stringtable, Sets: w.settable, + Dispatches: w.dispatchtable, TrackCount: w.trackcount, Caps: w.caps, Capsize: capsize, + CaptureSlotInUse: captureSlotsInUse(w.emitted, capsize), FcPrefix: fcPrefix, BmPrefix: bmPrefix, Anchors: getAnchors(tree), RightToLeft: rtl, FindOptimizations: tree.FindOptimizations, + LeftContextRunes: AnalyzeLeftContext(tree.Root), }, nil } +// AnalyzeLeftContext returns how many runes before a candidate start the matcher +// may inspect. Slicing the input down to that candidate is legal only when no +// opcode depends on the original search origin or unbounded left text. +// +// 0 never looks left of the start position +// 1 one previous rune is enough for \b, or to keep ^/\A from seeing +// the candidate as the original start (they test leftchars()==0) +// -1 do not slice: lookbehind, or \G (NtStart), which keys off textstart +func AnalyzeLeftContext(n *RegexNode) int { + if n == nil { + return 0 + } + + need := 0 + switch n.T { + case NtPosLook, NtNegLook: + if n.Options&RightToLeft != 0 { + return -1 + } + case NtStart: + return -1 + case NtBol, NtBeginning, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary: + need = 1 + } + + for _, child := range n.Children { + childNeed := AnalyzeLeftContext(child) + if childNeed < 0 { + return -1 + } + if childNeed > need { + need = childNeed + } + } + return need +} + // The main RegexCode generator. It does a depth-first walk // through the tree and calls EmitFragment to emits code before // and after each child of an interior node, and at each leaf. @@ -171,13 +275,37 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) case NtConcatenate | BeforeChild, NtConcatenate | AfterChild, NtEmpty: case NtAlternate | BeforeChild: - if curIndex < len(node.Children)-1 { + if sets, leaders, _, ok := w.getDispatchCandidates(node); ok { + if curIndex == 0 { + w.dispatchCodes[node] = w.dispatchCode(sets) + w.emit1(Dispatch|bits, w.dispatchCodes[node]) + } + w.preconsumed[leaders[curIndex]] = true + w.patchDispatchBranch(node, curIndex, w.curPos()) + } else if curIndex < len(node.Children)-1 { w.pushInt(w.curPos()) w.emit1(Lazybranch, 0) } case NtAlternate | AfterChild: - if curIndex < len(node.Children)-1 { + if _, _, complete, ok := w.getDispatchCandidates(node); ok { + if curIndex < len(node.Children)-1 && !complete[curIndex] { + gotoPos := w.curPos() + w.emit1(Goto, 0) + w.dispatchGotos[node] = append(w.dispatchGotos[node], gotoPos) + } + if curIndex == len(node.Children)-1 { + end := w.curPos() + for _, gotoPos := range w.dispatchGotos[node] { + w.patchJump(gotoPos, end) + } + for branch, isComplete := range complete { + if isComplete { + w.patchDispatchBranch(node, branch, end) + } + } + } + } else if curIndex < len(node.Children)-1 { lbPos := w.popInt() w.pushInt(w.curPos()) w.emit1(Goto, 0) @@ -281,10 +409,14 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) case NtGroup | BeforeChild, NtGroup | AfterChild: case NtCapture | BeforeChild: - w.emit(Setmark) + if w.emitCapture(node) { + w.emit(Setmark) + } case NtCapture | AfterChild: - w.emit2(Capturemark, w.mapCapnum(node.M), w.mapCapnum(node.N)) + if w.emitCapture(node) { + w.emit2(Capturemark, w.mapCapnum(node.M), w.mapCapnum(node.N)) + } case NtPosLook | BeforeChild: // NOTE: the following line causes lookahead/lookbehind to be @@ -317,7 +449,9 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) w.emit(Forejump) case NtOne, NtNotone: - w.emit1(InstOp(node.T|ntBits), int(node.Ch)) + if !w.preconsumed[node] { + w.emit1(InstOp(node.T|ntBits), int(node.Ch)) + } case NtNotoneloop, NtNotoneloopatomic, NtNotonelazy, NtOneloop, NtOneloopatomic, NtOnelazy: if node.M > 0 { @@ -348,10 +482,22 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) } case NtMulti: - w.emit1(InstOp(node.T|ntBits), w.stringCode(node.Str)) + str := node.Str + if w.preconsumed[node] { + if bits&Rtl != 0 { + str = str[:len(str)-1] + } else { + str = str[1:] + } + } + if len(str) > 0 { + w.emit1(InstOp(node.T|ntBits), w.stringCode(str)) + } case NtSet: - w.emit1(InstOp(node.T|ntBits), w.setCode(node.Set)) + if !w.preconsumed[node] { + w.emit1(InstOp(node.T|ntBits), w.setCode(node.Set)) + } case NtRef: w.emit1(InstOp(node.T|ntBits), w.mapCapnum(node.M)) @@ -359,6 +505,9 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) case NtNothing, NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, NtBeginning, NtStart, NtEndZ, NtEnd, NtUpdateBumpalong: w.emit(InstOp(node.T)) + case NtGrapheme: + w.emit(InstOp(node.T | ntBits)) + default: return fmt.Errorf("unexpected opcode in regular expression generation: %v", nodetype) } @@ -366,6 +515,17 @@ func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) return nil } +func (w *writer) emitCapture(node *RegexNode) bool { + if w.quickCaptureSlots == nil { + return true + } + capnum, uncapnum := w.mapCapnum(node.M), w.mapCapnum(node.N) + if uncapnum != -1 { + return true + } + return capnum >= 0 && (capnum >= len(w.quickCaptureSlots) || w.quickCaptureSlots[capnum]) +} + // To avoid recursion, we use a simple integer stack. // This is the push. func (w *writer) pushInt(i int) { @@ -398,6 +558,53 @@ func (w *writer) patchJump(offset, jumpDest int) { w.emitted[offset+1] = jumpDest } +func (w *writer) getDispatchCandidates(node *RegexNode) ([]*CharSet, []*RegexNode, []bool, bool) { + if info, found := w.dispatchInfo[node]; found { + return info.sets, info.leaders, info.complete, info.ok + } + sets, leaders, complete, ok := node.dispatchCandidates() + w.dispatchInfo[node] = dispatchInfo{sets: sets, leaders: leaders, complete: complete, ok: ok} + return sets, leaders, complete, ok +} + +func (w *writer) dispatchCode(sets []*CharSet) int { + if w.counting { + return 0 + } + table := DispatchTable{ + Sets: make([]int, len(sets)), + Branches: make([]int, len(sets)), + } + if len(sets) >= 4 { + table.ASCII = &[128]uint16{} + } else { + table.ASCIIMasks = make([]uint64, len(sets)*2) + } + for i, set := range sets { + table.Sets[i] = w.setCode(set) + for ch := rune(0); ch < 128; ch++ { + if set.CharIn(ch) { + if table.ASCII != nil { + table.ASCII[ch] = uint16(i + 1) + } else { + table.ASCIIMasks[i*2+int(ch>>6)] |= uint64(1) << (ch & 63) + } + } + } + } + index := len(w.dispatchtable) + w.dispatchtable = append(w.dispatchtable, table) + return index +} + +func (w *writer) patchDispatchBranch(node *RegexNode, branch, target int) { + if w.counting { + return + } + table := w.dispatchCodes[node] + w.dispatchtable[table].Branches[branch] = target +} + // Returns an index in the set table for a charset // uses a map to eliminate duplicates. func (w *writer) setCode(set *CharSet) int { diff --git a/vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md b/vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md index 3879f14a..f349b335 100644 --- a/vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md +++ b/vendor/github.com/lucasb-eyer/go-colorful/CHANGELOG.md @@ -8,6 +8,10 @@ but only releases after v1.0.3 properly adhere to it. ## [Unreleased] +## [1.4.1] - 2026-08-02 +### Fixed +- Corrected `D50ToD65` to use the CSS Color 4 matrix inverse of `D65ToD50` (#85). + ## [1.4.0] - 2026-03-28 ### Added - Constructors, decomposers, and blend functions for the CSS Color Level 4 wide-gamut RGB color spaces `DisplayP3`, `A98Rgb`, `ProPhotoRgb`, and `Rec2020` (#81) diff --git a/vendor/github.com/lucasb-eyer/go-colorful/widegamut.go b/vendor/github.com/lucasb-eyer/go-colorful/widegamut.go index 6805a2b9..63c3e878 100644 --- a/vendor/github.com/lucasb-eyer/go-colorful/widegamut.go +++ b/vendor/github.com/lucasb-eyer/go-colorful/widegamut.go @@ -10,9 +10,9 @@ import "math" // Bradford chromatic adaptation between D50 and D65 illuminants. func D50ToD65(x, y, z float64) (xo, yo, zo float64) { - xo = 0.9555766*x - 0.0230393*y + 0.0631636*z - yo = -0.0282895*x + 1.0099416*y + 0.0210077*z - zo = 0.0122982*x - 0.0204830*y + 1.3299098*z + xo = 0.9554734527042182*x - 0.023098536874261423*y + 0.06325964552894382*z + yo = -0.028369706963208136*x + 1.0099954580058226*y + 0.021041398966943008*z + zo = 0.012314001688319899*x - 0.020507696433477912*y + 1.3303659366080753*z return } diff --git a/vendor/github.com/mattn/go-isatty/isatty_others.go b/vendor/github.com/mattn/go-isatty/isatty_others.go index b24a2fad..569113ea 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_others.go +++ b/vendor/github.com/mattn/go-isatty/isatty_others.go @@ -1,5 +1,5 @@ -//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2) && !windows -// +build appengine js nacl tinygo wasm wasip1 wasip2 +//go:build (appengine || js || nacl || tinygo || wasm || wasip1 || wasip2 || haiku) && !windows +// +build appengine js nacl tinygo wasm wasip1 wasip2 haiku // +build !windows package isatty diff --git a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go b/vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go similarity index 62% rename from vendor/github.com/mattn/go-isatty/isatty_tcgets.go rename to vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go index 0337d8cf..6aecf870 100644 --- a/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +++ b/vendor/github.com/mattn/go-isatty/isatty_tiocgwinsz.go @@ -8,8 +8,12 @@ package isatty import "golang.org/x/sys/unix" // IsTerminal return true if the file descriptor is terminal. +// TIOCGWINSZ is used instead of TCGETS because TCGETS shares its ioctl +// number with SNDCTL_TMR_TIMEBASE of the OSS sound API, so it may succeed +// (and even change the device mode) on non-tty devices. musl's isatty does +// the same. func IsTerminal(fd uintptr) bool { - _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) + _, err := unix.IoctlGetWinsize(int(fd), unix.TIOCGWINSZ) return err == nil } diff --git a/vendor/github.com/mattn/go-runewidth/runewidth.go b/vendor/github.com/mattn/go-runewidth/runewidth.go index d977fb87..33168549 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth.go @@ -4,6 +4,8 @@ import ( "os" "sort" "strings" + "sync" + "sync/atomic" "unicode/utf8" "github.com/clipperhouse/uax29/v2/graphemes" @@ -34,22 +36,73 @@ var ( ) var ( - zerowidth table // combining + nonprint merged for faster zero-width lookup - widewidth table // ambiguous + doublewidth merged for EA path - eastAsianWidth widthTable - eastAsianWidth0 [0x300]byte - strictWidthLUT [2][0x110000]byte + zerowidth table // combining + nonprint merged for faster zero-width lookup + widewidth table // ambiguous + doublewidth merged for EA path + eastAsianWidth widthTable + tablesOnce sync.Once + + // strictWidthLUT is mostly built lazily on the first width lookup so + // that importing the package costs neither the build time nor the 2 MB + // of resident memory; see issue #104. Only the entries below + // strictWidthLUTLimit are valid: init fills the first 0x300 entries of + // both planes, and the lazy build fills the rest — never rewriting the + // low region, so readers of it cannot race with the build. The limit + // is loaded with acquire semantics, which makes the non-atomic reads + // of the high region safe once it reports 0x110000. Keeping the whole + // check down to one compare-and-branch matters: RuneWidth is only a + // dozen instructions long. + strictWidthLUT [2][0x110000]byte + strictWidthLUTLimit atomic.Int32 + strictWidthLUTOnce sync.Once ) func init() { + initStrictWidthLUTLow() + strictWidthLUTLimit.Store(0x300) + handleEnv() +} + +// initStrictWidthLUTLow paints the first 0x300 entries of strictWidthLUT +// from the static interval tables. The result must stay identical to +// runeWidthNoLUT for runes below 0x300, which TestStrictWidthLUT verifies. +func initStrictWidthLUTLow() { + for i := 0; i < 0x300; i++ { + r := rune(i) + w := byte(1) + if r < 0x20 || (r >= 0x7F && r <= 0x9F) || r == 0xAD { // nonprint + w = 0 + } + strictWidthLUT[0][i] = w + } + + ea := strictWidthLUT[1][:0x300] + fillBytes(ea, 1) + paint := func(t table, w byte) { + for _, iv := range t { + if iv.first >= 0x300 { + break + } + last := iv.last + if last > 0x2FF { + last = 0x2FF + } + fillBytes(ea[iv.first:last+1], w) + } + } + paint(ambiguous, 2) + paint(doublewidth, 2) + // zero-width wins over wide on overlap, so paint it last. + paint(combining, 0) + paint(nonprint, 0) +} + +// initTables builds the merged lookup tables. It runs lazily through +// tablesOnce so that merely importing the package stays cheap; see issue +// #104. +func initTables() { zerowidth = mergeIntervals(combining, nonprint) widewidth = mergeIntervals(ambiguous, doublewidth) eastAsianWidth = makeWidthTable(zerowidth, widewidth) - for r := range eastAsianWidth0 { - eastAsianWidth0[r] = byte(runeWidthEastAsianNoCache(rune(r), true)) - } - initStrictWidthLUT() - handleEnv() } func mergeIntervals(t1, t2 table) table { @@ -200,6 +253,7 @@ func inWidthTable(r rune, t widthTable) (int, bool) { } func runeWidthNoLUT(r rune, eastAsian, strictEmojiNeutral bool) int { + tablesOnce.Do(initTables) if !eastAsian { if r < 0x20 { return 0 @@ -221,7 +275,7 @@ func runeWidthNoLUT(r rune, eastAsian, strictEmojiNeutral bool) int { } if r < 0x300 { - return int(eastAsianWidth0[r]) + return int(strictWidthLUT[1][r]) } if w, ok := inWidthTable(r, eastAsianWidth); ok { return w @@ -232,22 +286,60 @@ func runeWidthNoLUT(r rune, eastAsian, strictEmojiNeutral bool) int { return 1 } -func runeWidthEastAsianNoCache(r rune, strictEmojiNeutral bool) int { - if w, ok := inWidthTable(r, eastAsianWidth); ok { - return w - } - if !strictEmojiNeutral && inTable(r, emoji) { - return 2 +// fillBytes sets every byte of b to v. It doubles the copied region on each +// iteration so large slices are filled at memcpy speed instead of one byte +// per loop iteration. +func fillBytes(b []byte, v byte) { + if len(b) == 0 { + return } - return 1 -} + b[0] = v + for i := 1; i < len(b); i *= 2 { + copy(b[i:], b[:i]) + } +} + +// buildStrictWidthLUT builds the strict-width lookup table above 0x300 +// exactly once. It paints whole intervals instead of computing every rune +// through the binary searches in runeWidthNoLUT. It must not write below +// 0x300: that region was filled by init and may be read concurrently. The +// result must stay identical to runeWidthNoLUT(r, eastAsian, true), which +// TestStrictWidthLUT verifies. +func buildStrictWidthLUT() { + strictWidthLUTOnce.Do(func() { + tablesOnce.Do(initTables) + + // paintHigh fills lut with w over each interval, clipped to 0x300+. + paintHigh := func(lut []byte, first, last rune, w byte) { + if first < 0x300 { + if last < 0x300 { + return + } + first = 0x300 + } + fillBytes(lut[first:last+1], w) + } -func initStrictWidthLUT() { - for i := range strictWidthLUT[0] { - r := rune(i) - strictWidthLUT[0][i] = byte(runeWidthNoLUT(r, false, true)) - strictWidthLUT[1][i] = byte(runeWidthNoLUT(r, true, true)) - } + // EastAsianWidth=false, StrictEmojiNeutral=true + lut := strictWidthLUT[0][:] + fillBytes(lut[0x300:], 1) + for _, iv := range doublewidth { + paintHigh(lut, iv.first, iv.last, 2) + } + // zerowidth is checked before doublewidth, so it wins on overlap. + for _, iv := range zerowidth { + paintHigh(lut, iv.first, iv.last, 0) + } + + // EastAsianWidth=true, StrictEmojiNeutral=true + lut = strictWidthLUT[1][:] + fillBytes(lut[0x300:], 1) + for _, iv := range eastAsianWidth { + paintHigh(lut, iv.first, iv.last, iv.width) + } + + strictWidthLUTLimit.Store(0x110000) + }) } var private = table{ @@ -286,9 +378,30 @@ func NewCondition() *Condition { // RuneWidth returns the number of cells in r. // See http://www.unicode.org/reports/tr11/ func (c *Condition) RuneWidth(r rune) int { + // This one compare doubles as the range check and the lazy-LUT check: + // out-of-range runes and runes above the built portion of + // strictWidthLUT both take the slow path. Once the LUT is fully built + // the limit is 0x110000 and only invalid runes go slow. + if uint32(r) >= uint32(strictWidthLUTLimit.Load()) { + return c.runeWidthSlow(r) + } + if len(c.combinedLut) > 0 { + return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 + } + if c.StrictEmojiNeutral { + if c.EastAsianWidth { + return int(strictWidthLUT[1][r]) + } + return int(strictWidthLUT[0][r]) + } + return runeWidthNoLUT(r, c.EastAsianWidth, c.StrictEmojiNeutral) +} + +func (c *Condition) runeWidthSlow(r rune) int { if r < 0 || r > 0x10FFFF { return 0 } + buildStrictWidthLUT() if len(c.combinedLut) > 0 { return int(c.combinedLut[r>>1]>>(uint(r&1)*4)) & 3 } diff --git a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go index 5a31d738..16673af3 100644 --- a/vendor/github.com/mattn/go-runewidth/runewidth_posix.go +++ b/vendor/github.com/mattn/go-runewidth/runewidth_posix.go @@ -5,35 +5,50 @@ package runewidth import ( "os" - "regexp" "strings" ) -var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) +func mblen(charset string) int { + switch charset { + case "utf-8", "utf8": + return 6 + case "jis": + return 8 + case "eucjp": + return 3 + case "euckr", "euccn", "sjis", "cp932", "cp51932", "cp936", "cp949", "cp950", "big5", "gbk", "gb2312": + return 2 + } + return 1 +} -var mblenTable = map[string]int{ - "utf-8": 6, - "utf8": 6, - "jis": 8, - "eucjp": 3, - "euckr": 2, - "euccn": 2, - "sjis": 2, - "cp932": 2, - "cp51932": 2, - "cp936": 2, - "cp949": 2, - "cp950": 2, - "big5": 2, - "gbk": 2, - "gb2312": 2, +// localeCharset extracts the charset part of a locale name of the form +// "ll.CHARSET" or "ll_CC.CHARSET" (two- or three-letter language code, +// optional uppercase country code). It returns "" if locale does not have +// that shape. +func localeCharset(locale string) string { + n := 0 + for n < len(locale) && locale[n] >= 'a' && locale[n] <= 'z' { + n++ + } + if n < 2 || n > 3 { + return "" + } + rest := locale[n:] + if len(rest) >= 3 && rest[0] == '_' && + rest[1] >= 'A' && rest[1] <= 'Z' && rest[2] >= 'A' && rest[2] <= 'Z' { + rest = rest[3:] + } + if len(rest) >= 2 && rest[0] == '.' { + return rest[1:] + } + return "" } func isEastAsian(locale string) bool { charset := strings.ToLower(locale) - r := reLoc.FindStringSubmatch(locale) - if len(r) == 2 { - charset = strings.ToLower(r[1]) + if cs := localeCharset(locale); cs != "" { + charset = strings.ToLower(cs) } if strings.HasSuffix(charset, "@cjk_narrow") { @@ -46,10 +61,7 @@ func isEastAsian(locale string) bool { break } } - max := 1 - if m, ok := mblenTable[charset]; ok { - max = m - } + max := mblen(charset) if max > 1 && (charset[0] != 'u' || strings.HasPrefix(locale, "ja") || strings.HasPrefix(locale, "ko") || diff --git a/vendor/github.com/stretchr/testify/assert/assertions.go b/vendor/github.com/stretchr/testify/assert/assertions.go index 1419e477..166f6372 100644 --- a/vendor/github.com/stretchr/testify/assert/assertions.go +++ b/vendor/github.com/stretchr/testify/assert/assertions.go @@ -17,7 +17,7 @@ import ( "unicode" "unicode/utf8" - // Wrapper around gopkg.in/yaml.v3 + // Wrapper around go.yaml.in/yaml/v3 "github.com/stretchr/testify/assert/yaml" "github.com/stretchr/testify/internal/difflib" "github.com/stretchr/testify/internal/spew" diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go index 5a74c4f4..956227ca 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_custom.go @@ -7,7 +7,7 @@ // go test -tags testify_yaml_custom // // This implementation can be used at build time to replace the default implementation -// to avoid linking with [gopkg.in/yaml.v3]. +// to avoid linking with [go.yaml.in/yaml/v3]. // // In your test package: // diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go index 0bae80e3..dd89ac03 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_default.go @@ -6,7 +6,7 @@ // indirection with an alternative implementation of this package that uses // another implementation of YAML deserialization. This allows to not either not // use YAML deserialization at all, or to use another implementation than -// [gopkg.in/yaml.v3] (for example for license compatibility reasons, see [PR #1120]). +// [go.yaml.in/yaml/v3] (for example for license compatibility reasons, see [PR #1120]). // // Alternative implementations are selected using build tags: // @@ -28,9 +28,9 @@ // [PR #1120]: https://github.com/stretchr/testify/pull/1120 package yaml -import goyaml "gopkg.in/yaml.v3" +import goyaml "go.yaml.in/yaml/v3" -// Unmarshal is just a wrapper of [gopkg.in/yaml.v3.Unmarshal]. +// Unmarshal is just a wrapper of [go.yaml.in/yaml/v3.Unmarshal]. func Unmarshal(in []byte, out interface{}) error { return goyaml.Unmarshal(in, out) } diff --git a/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go b/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go index 8041803f..a51d2792 100644 --- a/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go +++ b/vendor/github.com/stretchr/testify/assert/yaml/yaml_fail.go @@ -3,7 +3,7 @@ // Package yaml is an implementation of YAML functions that always fail. // // This implementation can be used at build time to replace the default implementation -// to avoid linking with [gopkg.in/yaml.v3]: +// to avoid linking with [go.yaml.in/yaml/v3]: // // go test -tags testify_yaml_fail package yaml diff --git a/vendor/github.com/xo/terminfo/dec.go b/vendor/github.com/xo/terminfo/dec.go index dacc88e3..f650c2dd 100644 --- a/vendor/github.com/xo/terminfo/dec.go +++ b/vendor/github.com/xo/terminfo/dec.go @@ -6,7 +6,7 @@ import ( const ( // maxFileLength is the max file length. - maxFileLength = 4096 + maxFileLength = 32768 // magic is the file magic for terminfo files. magic = 0o432 // magicExtended is the file magic for terminfo files with the extended diff --git a/vendor/gopkg.in/yaml.v3/LICENSE b/vendor/go.yaml.in/yaml/v3/LICENSE similarity index 100% rename from vendor/gopkg.in/yaml.v3/LICENSE rename to vendor/go.yaml.in/yaml/v3/LICENSE diff --git a/vendor/gopkg.in/yaml.v3/NOTICE b/vendor/go.yaml.in/yaml/v3/NOTICE similarity index 100% rename from vendor/gopkg.in/yaml.v3/NOTICE rename to vendor/go.yaml.in/yaml/v3/NOTICE diff --git a/vendor/go.yaml.in/yaml/v3/README.md b/vendor/go.yaml.in/yaml/v3/README.md new file mode 100644 index 00000000..15a85a63 --- /dev/null +++ b/vendor/go.yaml.in/yaml/v3/README.md @@ -0,0 +1,171 @@ +go.yaml.in/yaml +=============== + +YAML Support for the Go Language + + +## Introduction + +The `yaml` package enables [Go](https://go.dev/) programs to comfortably encode +and decode [YAML](https://yaml.org/) values. + +It was originally developed within [Canonical](https://www.canonical.com) as +part of the [juju](https://juju.ubuntu.com) project, and is based on a pure Go +port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) C library to +parse and generate YAML data quickly and reliably. + + +## Project Status + +This project started as a fork of the extremely popular [go-yaml]( +https://github.com/go-yaml/yaml/) +project, and is being maintained by the official [YAML organization]( +https://github.com/yaml/). + +The YAML team took over ongoing maintenance and development of the project after +discussion with go-yaml's author, @niemeyer, following his decision to +[label the project repository as "unmaintained"]( +https://github.com/go-yaml/yaml/blob/944c86a7d2/README.md) in April 2025. + +We have put together a team of dedicated maintainers including representatives +of go-yaml's most important downstream projects. + +We will strive to earn the trust of the various go-yaml forks to switch back to +this repository as their upstream. + +Please [contact us](https://cloud-native.slack.com/archives/C08PPAT8PS7) if you +would like to contribute or be involved. + + +## Compatibility + +The `yaml` package supports most of YAML 1.2, but preserves some behavior from +1.1 for backwards compatibility. + +Specifically, v3 of the `yaml` package: + +* Supports YAML 1.1 bools (`yes`/`no`, `on`/`off`) as long as they are being + decoded into a typed bool value. + Otherwise they behave as a string. + Booleans in YAML 1.2 are `true`/`false` only. +* Supports octals encoded and decoded as `0777` per YAML 1.1, rather than + `0o777` as specified in YAML 1.2, because most parsers still use the old + format. + Octals in the `0o777` format are supported though, so new files work. +* Does not support base-60 floats. + These are gone from YAML 1.2, and were actually never supported by this + package as it's clearly a poor choice. + + +## Installation and Usage + +The import path for the package is *go.yaml.in/yaml/v3*. + +To install it, run: + +```bash +go get go.yaml.in/yaml/v3 +``` + + +## API Documentation + +See: + + +## API Stability + +The package API for yaml v3 will remain stable as described in [gopkg.in]( +https://gopkg.in). + + +## Example + +```go +package main + +import ( + "fmt" + "log" + + "go.yaml.in/yaml/v3" +) + +var data = ` +a: Easy! +b: + c: 2 + d: [3, 4] +` + +// Note: struct fields must be public in order for unmarshal to +// correctly populate the data. +type T struct { + A string + B struct { + RenamedC int `yaml:"c"` + D []int `yaml:",flow"` + } +} + +func main() { + t := T{} + + err := yaml.Unmarshal([]byte(data), &t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t:\n%v\n\n", t) + + d, err := yaml.Marshal(&t) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- t dump:\n%s\n\n", string(d)) + + m := make(map[interface{}]interface{}) + + err = yaml.Unmarshal([]byte(data), &m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m:\n%v\n\n", m) + + d, err = yaml.Marshal(&m) + if err != nil { + log.Fatalf("error: %v", err) + } + fmt.Printf("--- m dump:\n%s\n\n", string(d)) +} +``` + +This example will generate the following output: + +``` +--- t: +{Easy! {2 [3 4]}} + +--- t dump: +a: Easy! +b: + c: 2 + d: [3, 4] + + +--- m: +map[a:Easy! b:map[c:2 d:[3 4]]] + +--- m dump: +a: Easy! +b: + c: 2 + d: + - 3 + - 4 +``` + + +## License + +The yaml package is licensed under the MIT and Apache License 2.0 licenses. +Please see the LICENSE file for details. diff --git a/vendor/gopkg.in/yaml.v3/apic.go b/vendor/go.yaml.in/yaml/v3/apic.go similarity index 99% rename from vendor/gopkg.in/yaml.v3/apic.go rename to vendor/go.yaml.in/yaml/v3/apic.go index ae7d049f..05fd305d 100644 --- a/vendor/gopkg.in/yaml.v3/apic.go +++ b/vendor/go.yaml.in/yaml/v3/apic.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/vendor/gopkg.in/yaml.v3/decode.go b/vendor/go.yaml.in/yaml/v3/decode.go similarity index 97% rename from vendor/gopkg.in/yaml.v3/decode.go rename to vendor/go.yaml.in/yaml/v3/decode.go index 0173b698..02e2b17b 100644 --- a/vendor/gopkg.in/yaml.v3/decode.go +++ b/vendor/go.yaml.in/yaml/v3/decode.go @@ -832,10 +832,10 @@ func (d *decoder) mapping(n *Node, out reflect.Value) (good bool) { if d.unmarshal(n.Content[i], k) { if mergedFields != nil { ki := k.Interface() - if mergedFields[ki] { + if d.getPossiblyUnhashableKey(mergedFields, ki) { continue } - mergedFields[ki] = true + d.setPossiblyUnhashableKey(mergedFields, ki, true) } kkind := k.Kind() if kkind == reflect.Interface { @@ -956,6 +956,24 @@ func failWantMap() { failf("map merge requires map or sequence of maps as the value") } +func (d *decoder) setPossiblyUnhashableKey(m map[interface{}]bool, key interface{}, value bool) { + defer func() { + if err := recover(); err != nil { + failf("%v", err) + } + }() + m[key] = value +} + +func (d *decoder) getPossiblyUnhashableKey(m map[interface{}]bool, key interface{}) bool { + defer func() { + if err := recover(); err != nil { + failf("%v", err) + } + }() + return m[key] +} + func (d *decoder) merge(parent *Node, merge *Node, out reflect.Value) { mergedFields := d.mergedFields if mergedFields == nil { @@ -963,7 +981,7 @@ func (d *decoder) merge(parent *Node, merge *Node, out reflect.Value) { for i := 0; i < len(parent.Content); i += 2 { k := reflect.New(ifaceType).Elem() if d.unmarshal(parent.Content[i], k) { - d.mergedFields[k.Interface()] = true + d.setPossiblyUnhashableKey(d.mergedFields, k.Interface(), true) } } } diff --git a/vendor/gopkg.in/yaml.v3/emitterc.go b/vendor/go.yaml.in/yaml/v3/emitterc.go similarity index 95% rename from vendor/gopkg.in/yaml.v3/emitterc.go rename to vendor/go.yaml.in/yaml/v3/emitterc.go index 0f47c9ca..ab4e03ba 100644 --- a/vendor/gopkg.in/yaml.v3/emitterc.go +++ b/vendor/go.yaml.in/yaml/v3/emitterc.go @@ -162,10 +162,9 @@ func yaml_emitter_emit(emitter *yaml_emitter_t, event *yaml_event_t) bool { // Check if we need to accumulate more events before emitting. // // We accumulate extra -// - 1 event for DOCUMENT-START -// - 2 events for SEQUENCE-START -// - 3 events for MAPPING-START -// +// - 1 event for DOCUMENT-START +// - 2 events for SEQUENCE-START +// - 3 events for MAPPING-START func yaml_emitter_need_more_events(emitter *yaml_emitter_t) bool { if emitter.events_head == len(emitter.events) { return true @@ -226,7 +225,7 @@ func yaml_emitter_append_tag_directive(emitter *yaml_emitter_t, value *yaml_tag_ } // Increase the indentation level. -func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool { +func yaml_emitter_increase_indent_compact(emitter *yaml_emitter_t, flow, indentless bool, compact_seq bool) bool { emitter.indents = append(emitter.indents, emitter.indent) if emitter.indent < 0 { if flow { @@ -241,7 +240,14 @@ func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool emitter.indent += 2 } else { // Everything else aligns to the chosen indentation. - emitter.indent = emitter.best_indent*((emitter.indent+emitter.best_indent)/emitter.best_indent) + emitter.indent = emitter.best_indent * ((emitter.indent + emitter.best_indent) / emitter.best_indent) + if compact_seq { + // The value compact_seq passed in is almost always set to `false` when this function is called, + // except when we are dealing with sequence nodes. So this gets triggered to subtract 2 only when we + // are increasing the indent to account for sequence nodes, which will be correct because we need to + // subtract 2 to account for the - at the beginning of the sequence node. + emitter.indent = emitter.indent - 2 + } } } return true @@ -478,6 +484,18 @@ func yaml_emitter_emit_document_start(emitter *yaml_emitter_t, event *yaml_event return yaml_emitter_set_emitter_error(emitter, "expected DOCUMENT-START or STREAM-END") } +// yaml_emitter_increase_indent preserves the original signature and delegates to +// yaml_emitter_increase_indent_compact without compact-sequence indentation +func yaml_emitter_increase_indent(emitter *yaml_emitter_t, flow, indentless bool) bool { + return yaml_emitter_increase_indent_compact(emitter, flow, indentless, false) +} + +// yaml_emitter_process_line_comment preserves the original signature and delegates to +// yaml_emitter_process_line_comment_linebreak passing false for linebreak +func yaml_emitter_process_line_comment(emitter *yaml_emitter_t) bool { + return yaml_emitter_process_line_comment_linebreak(emitter, false) +} + // Expect the root node. func yaml_emitter_emit_document_content(emitter *yaml_emitter_t, event *yaml_event_t) bool { emitter.states = append(emitter.states, yaml_EMIT_DOCUMENT_END_STATE) @@ -728,7 +746,16 @@ func yaml_emitter_emit_flow_mapping_value(emitter *yaml_emitter_t, event *yaml_e // Expect a block item node. func yaml_emitter_emit_block_sequence_item(emitter *yaml_emitter_t, event *yaml_event_t, first bool) bool { if first { - if !yaml_emitter_increase_indent(emitter, false, false) { + // emitter.mapping context tells us if we are currently in a mapping context. + // emiiter.column tells us which column we are in in the yaml output. 0 is the first char of the column. + // emitter.indentation tells us if the last character was an indentation character. + // emitter.compact_sequence_indent tells us if '- ' is considered part of the indentation for sequence elements. + // So, `seq` means that we are in a mapping context, and we are either at the first char of the column or + // the last character was not an indentation character, and we consider '- ' part of the indentation + // for sequence elements. + seq := emitter.mapping_context && (emitter.column == 0 || !emitter.indention) && + emitter.compact_sequence_indent + if !yaml_emitter_increase_indent_compact(emitter, false, false, seq) { return false } } @@ -1144,8 +1171,15 @@ func yaml_emitter_process_head_comment(emitter *yaml_emitter_t) bool { } // Write an line comment. -func yaml_emitter_process_line_comment(emitter *yaml_emitter_t) bool { +func yaml_emitter_process_line_comment_linebreak(emitter *yaml_emitter_t, linebreak bool) bool { if len(emitter.line_comment) == 0 { + // The next 3 lines are needed to resolve an issue with leading newlines + // See https://github.com/go-yaml/yaml/issues/755 + // When linebreak is set to true, put_break will be called and will add + // the needed newline. + if linebreak && !put_break(emitter) { + return false + } return true } if !emitter.whitespace { @@ -1894,7 +1928,7 @@ func yaml_emitter_write_literal_scalar(emitter *yaml_emitter_t, value []byte) bo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - if !yaml_emitter_process_line_comment(emitter) { + if !yaml_emitter_process_line_comment_linebreak(emitter, true) { return false } //emitter.indention = true @@ -1931,7 +1965,7 @@ func yaml_emitter_write_folded_scalar(emitter *yaml_emitter_t, value []byte) boo if !yaml_emitter_write_block_scalar_hints(emitter, value) { return false } - if !yaml_emitter_process_line_comment(emitter) { + if !yaml_emitter_process_line_comment_linebreak(emitter, true) { return false } diff --git a/vendor/gopkg.in/yaml.v3/encode.go b/vendor/go.yaml.in/yaml/v3/encode.go similarity index 100% rename from vendor/gopkg.in/yaml.v3/encode.go rename to vendor/go.yaml.in/yaml/v3/encode.go diff --git a/vendor/gopkg.in/yaml.v3/parserc.go b/vendor/go.yaml.in/yaml/v3/parserc.go similarity index 90% rename from vendor/gopkg.in/yaml.v3/parserc.go rename to vendor/go.yaml.in/yaml/v3/parserc.go index 268558a0..f35829db 100644 --- a/vendor/gopkg.in/yaml.v3/parserc.go +++ b/vendor/go.yaml.in/yaml/v3/parserc.go @@ -226,8 +226,9 @@ func yaml_parser_state_machine(parser *yaml_parser_t, event *yaml_event_t) bool } // Parse the production: -// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END -// ************ +// +// stream ::= STREAM-START implicit_document? explicit_document* STREAM-END +// ************ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -248,10 +249,11 @@ func yaml_parser_parse_stream_start(parser *yaml_parser_t, event *yaml_event_t) } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// * -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// ************************* +// +// implicit_document ::= block_node DOCUMENT-END* +// * +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// ************************* func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t, implicit bool) bool { token := peek_token(parser) @@ -355,9 +357,9 @@ func yaml_parser_parse_document_start(parser *yaml_parser_t, event *yaml_event_t } // Parse the productions: -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* -// *********** // +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* +// *********** func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -378,10 +380,10 @@ func yaml_parser_parse_document_content(parser *yaml_parser_t, event *yaml_event } // Parse the productions: -// implicit_document ::= block_node DOCUMENT-END* -// ************* -// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* // +// implicit_document ::= block_node DOCUMENT-END* +// ************* +// explicit_document ::= DIRECTIVE* DOCUMENT-START block_node? DOCUMENT-END* func yaml_parser_parse_document_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -427,31 +429,32 @@ func yaml_parser_set_event_comments(parser *yaml_parser_t, event *yaml_event_t) } // Parse the productions: -// block_node_or_indentless_sequence ::= -// ALIAS -// ***** -// | properties (block_content | indentless_block_sequence)? -// ********** * -// | block_content | indentless_block_sequence -// * -// block_node ::= ALIAS -// ***** -// | properties block_content? -// ********** * -// | block_content -// * -// flow_node ::= ALIAS -// ***** -// | properties flow_content? -// ********** * -// | flow_content -// * -// properties ::= TAG ANCHOR? | ANCHOR TAG? -// ************************* -// block_content ::= block_collection | flow_collection | SCALAR -// ****** -// flow_content ::= flow_collection | SCALAR -// ****** +// +// block_node_or_indentless_sequence ::= +// ALIAS +// ***** +// | properties (block_content | indentless_block_sequence)? +// ********** * +// | block_content | indentless_block_sequence +// * +// block_node ::= ALIAS +// ***** +// | properties block_content? +// ********** * +// | block_content +// * +// flow_node ::= ALIAS +// ***** +// | properties flow_content? +// ********** * +// | flow_content +// * +// properties ::= TAG ANCHOR? | ANCHOR TAG? +// ************************* +// block_content ::= block_collection | flow_collection | SCALAR +// ****** +// flow_content ::= flow_collection | SCALAR +// ****** func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, indentless_sequence bool) bool { //defer trace("yaml_parser_parse_node", "block:", block, "indentless_sequence:", indentless_sequence)() @@ -681,9 +684,9 @@ func yaml_parser_parse_node(parser *yaml_parser_t, event *yaml_event_t, block, i } // Parse the productions: -// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END -// ******************** *********** * ********* // +// block_sequence ::= BLOCK-SEQUENCE-START (BLOCK-ENTRY block_node?)* BLOCK-END +// ******************** *********** * ********* func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -739,8 +742,9 @@ func yaml_parser_parse_block_sequence_entry(parser *yaml_parser_t, event *yaml_e } // Parse the productions: -// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ -// *********** * +// +// indentless_sequence ::= (BLOCK-ENTRY block_node?)+ +// *********** * func yaml_parser_parse_indentless_sequence_entry(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -804,15 +808,15 @@ func yaml_parser_split_stem_comment(parser *yaml_parser_t, stem_len int) { } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// ******************* -// ((KEY block_node_or_indentless_sequence?)? -// *** * -// (VALUE block_node_or_indentless_sequence?)?)* // -// BLOCK-END -// ********* +// block_mapping ::= BLOCK-MAPPING_START +// ******************* +// ((KEY block_node_or_indentless_sequence?)? +// *** * +// (VALUE block_node_or_indentless_sequence?)?)* // +// BLOCK-END +// ********* func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -879,15 +883,14 @@ func yaml_parser_parse_block_mapping_key(parser *yaml_parser_t, event *yaml_even } // Parse the productions: -// block_mapping ::= BLOCK-MAPPING_START -// -// ((KEY block_node_or_indentless_sequence?)? // -// (VALUE block_node_or_indentless_sequence?)?)* -// ***** * -// BLOCK-END +// block_mapping ::= BLOCK-MAPPING_START // +// ((KEY block_node_or_indentless_sequence?)? // +// (VALUE block_node_or_indentless_sequence?)?)* +// ***** * +// BLOCK-END func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -914,17 +917,17 @@ func yaml_parser_parse_block_mapping_value(parser *yaml_parser_t, event *yaml_ev } // Parse the productions: -// flow_sequence ::= FLOW-SEQUENCE-START -// ******************* -// (flow_sequence_entry FLOW-ENTRY)* -// * ********** -// flow_sequence_entry? -// * -// FLOW-SEQUENCE-END -// ***************** -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * // +// flow_sequence ::= FLOW-SEQUENCE-START +// ******************* +// (flow_sequence_entry FLOW-ENTRY)* +// * ********** +// flow_sequence_entry? +// * +// FLOW-SEQUENCE-END +// ***************** +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -987,11 +990,10 @@ func yaml_parser_parse_flow_sequence_entry(parser *yaml_parser_t, event *yaml_ev return true } -// // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// *** * // +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// *** * func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1010,9 +1012,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_key(parser *yaml_parser_t, ev } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// ***** * // +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// ***** * func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1034,9 +1036,9 @@ func yaml_parser_parse_flow_sequence_entry_mapping_value(parser *yaml_parser_t, } // Parse the productions: -// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * // +// flow_sequence_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, event *yaml_event_t) bool { token := peek_token(parser) if token == nil { @@ -1052,17 +1054,17 @@ func yaml_parser_parse_flow_sequence_entry_mapping_end(parser *yaml_parser_t, ev } // Parse the productions: -// flow_mapping ::= FLOW-MAPPING-START -// ****************** -// (flow_mapping_entry FLOW-ENTRY)* -// * ********** -// flow_mapping_entry? -// ****************** -// FLOW-MAPPING-END -// **************** -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * *** * // +// flow_mapping ::= FLOW-MAPPING-START +// ****************** +// (flow_mapping_entry FLOW-ENTRY)* +// * ********** +// flow_mapping_entry? +// ****************** +// FLOW-MAPPING-END +// **************** +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * *** * func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event_t, first bool) bool { if first { token := peek_token(parser) @@ -1127,9 +1129,9 @@ func yaml_parser_parse_flow_mapping_key(parser *yaml_parser_t, event *yaml_event } // Parse the productions: -// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? -// * ***** * // +// flow_mapping_entry ::= flow_node | KEY flow_node? (VALUE flow_node?)? +// * ***** * func yaml_parser_parse_flow_mapping_value(parser *yaml_parser_t, event *yaml_event_t, empty bool) bool { token := peek_token(parser) if token == nil { diff --git a/vendor/gopkg.in/yaml.v3/readerc.go b/vendor/go.yaml.in/yaml/v3/readerc.go similarity index 99% rename from vendor/gopkg.in/yaml.v3/readerc.go rename to vendor/go.yaml.in/yaml/v3/readerc.go index b7de0a89..56af2453 100644 --- a/vendor/gopkg.in/yaml.v3/readerc.go +++ b/vendor/go.yaml.in/yaml/v3/readerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/vendor/gopkg.in/yaml.v3/resolve.go b/vendor/go.yaml.in/yaml/v3/resolve.go similarity index 100% rename from vendor/gopkg.in/yaml.v3/resolve.go rename to vendor/go.yaml.in/yaml/v3/resolve.go diff --git a/vendor/gopkg.in/yaml.v3/scannerc.go b/vendor/go.yaml.in/yaml/v3/scannerc.go similarity index 99% rename from vendor/gopkg.in/yaml.v3/scannerc.go rename to vendor/go.yaml.in/yaml/v3/scannerc.go index ca007010..30b1f089 100644 --- a/vendor/gopkg.in/yaml.v3/scannerc.go +++ b/vendor/go.yaml.in/yaml/v3/scannerc.go @@ -1614,11 +1614,11 @@ func yaml_parser_scan_to_next_token(parser *yaml_parser_t) bool { // Scan a YAML-DIRECTIVE or TAG-DIRECTIVE token. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// %YAML 1.1 # a comment \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool { // Eat '%'. start_mark := parser.mark @@ -1719,11 +1719,11 @@ func yaml_parser_scan_directive(parser *yaml_parser_t, token *yaml_token_t) bool // Scan the directive name. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^ -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^ // +// %YAML 1.1 # a comment \n +// ^^^^ +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^ func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark_t, name *[]byte) bool { // Consume the directive name. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -1758,8 +1758,9 @@ func yaml_parser_scan_directive_name(parser *yaml_parser_t, start_mark yaml_mark // Scan the value of VERSION-DIRECTIVE. // // Scope: -// %YAML 1.1 # a comment \n -// ^^^^^^ +// +// %YAML 1.1 # a comment \n +// ^^^^^^ func yaml_parser_scan_version_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, major, minor *int8) bool { // Eat whitespaces. if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { @@ -1797,10 +1798,11 @@ const max_number_length = 2 // Scan the version number of VERSION-DIRECTIVE. // // Scope: -// %YAML 1.1 # a comment \n -// ^ -// %YAML 1.1 # a comment \n -// ^ +// +// %YAML 1.1 # a comment \n +// ^ +// %YAML 1.1 # a comment \n +// ^ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark yaml_mark_t, number *int8) bool { // Repeat while the next character is digit. @@ -1834,9 +1836,9 @@ func yaml_parser_scan_version_directive_number(parser *yaml_parser_t, start_mark // Scan the value of a TAG-DIRECTIVE token. // // Scope: -// %TAG !yaml! tag:yaml.org,2002: \n -// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // +// %TAG !yaml! tag:yaml.org,2002: \n +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ func yaml_parser_scan_tag_directive_value(parser *yaml_parser_t, start_mark yaml_mark_t, handle, prefix *[]byte) bool { var handle_value, prefix_value []byte @@ -2847,7 +2849,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t continue } if parser.buffer[parser.buffer_pos+peek] == '#' { - seen := parser.mark.index+peek + seen := parser.mark.index + peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false @@ -2876,7 +2878,7 @@ func yaml_parser_scan_line_comment(parser *yaml_parser_t, token_mark yaml_mark_t parser.comments = append(parser.comments, yaml_comment_t{ token_mark: token_mark, start_mark: start_mark, - line: text, + line: text, }) } return true @@ -2910,7 +2912,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo // the foot is the line below it. var foot_line = -1 if scan_mark.line > 0 { - foot_line = parser.mark.line-parser.newlines+1 + foot_line = parser.mark.line - parser.newlines + 1 if parser.newlines == 0 && parser.mark.column > 1 { foot_line++ } @@ -2996,7 +2998,7 @@ func yaml_parser_scan_comments(parser *yaml_parser_t, scan_mark yaml_mark_t) boo recent_empty = false // Consume until after the consumed comment line. - seen := parser.mark.index+peek + seen := parser.mark.index + peek for { if parser.unread < 1 && !yaml_parser_update_buffer(parser, 1) { return false diff --git a/vendor/gopkg.in/yaml.v3/sorter.go b/vendor/go.yaml.in/yaml/v3/sorter.go similarity index 100% rename from vendor/gopkg.in/yaml.v3/sorter.go rename to vendor/go.yaml.in/yaml/v3/sorter.go diff --git a/vendor/gopkg.in/yaml.v3/writerc.go b/vendor/go.yaml.in/yaml/v3/writerc.go similarity index 99% rename from vendor/gopkg.in/yaml.v3/writerc.go rename to vendor/go.yaml.in/yaml/v3/writerc.go index b8a116bf..266d0b09 100644 --- a/vendor/gopkg.in/yaml.v3/writerc.go +++ b/vendor/go.yaml.in/yaml/v3/writerc.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE diff --git a/vendor/gopkg.in/yaml.v3/yaml.go b/vendor/go.yaml.in/yaml/v3/yaml.go similarity index 91% rename from vendor/gopkg.in/yaml.v3/yaml.go rename to vendor/go.yaml.in/yaml/v3/yaml.go index 8cec6da4..0b101cd2 100644 --- a/vendor/gopkg.in/yaml.v3/yaml.go +++ b/vendor/go.yaml.in/yaml/v3/yaml.go @@ -17,8 +17,7 @@ // // Source code and other details for the project are available at GitHub: // -// https://github.com/go-yaml/yaml -// +// https://github.com/yaml/go-yaml package yaml import ( @@ -75,16 +74,15 @@ type Marshaler interface { // // For example: // -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// var t T -// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) +// type T struct { +// F int `yaml:"a,omitempty"` +// B int +// } +// var t T +// yaml.Unmarshal([]byte("a: 1\nb: 2"), &t) // // See the documentation of Marshal for the format of tags and a list of // supported tag options. -// func Unmarshal(in []byte, out interface{}) (err error) { return unmarshal(in, out, false) } @@ -185,36 +183,35 @@ func unmarshal(in []byte, out interface{}, strict bool) (err error) { // // The field tag format accepted is: // -// `(...) yaml:"[][,[,]]" (...)` +// `(...) yaml:"[][,[,]]" (...)` // // The following flags are currently supported: // -// omitempty Only include the field if it's not set to the zero -// value for the type or to empty slices or maps. -// Zero valued structs will be omitted if all their public -// fields are zero, unless they implement an IsZero -// method (see the IsZeroer interface type), in which -// case the field will be excluded if IsZero returns true. +// omitempty Only include the field if it's not set to the zero +// value for the type or to empty slices or maps. +// Zero valued structs will be omitted if all their public +// fields are zero, unless they implement an IsZero +// method (see the IsZeroer interface type), in which +// case the field will be excluded if IsZero returns true. // -// flow Marshal using a flow style (useful for structs, -// sequences and maps). +// flow Marshal using a flow style (useful for structs, +// sequences and maps). // -// inline Inline the field, which must be a struct or a map, -// causing all of its fields or keys to be processed as if -// they were part of the outer struct. For maps, keys must -// not conflict with the yaml keys of other struct fields. +// inline Inline the field, which must be a struct or a map, +// causing all of its fields or keys to be processed as if +// they were part of the outer struct. For maps, keys must +// not conflict with the yaml keys of other struct fields. // // In addition, if the key is "-", the field is ignored. // // For example: // -// type T struct { -// F int `yaml:"a,omitempty"` -// B int -// } -// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" -// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" -// +// type T struct { +// F int `yaml:"a,omitempty"` +// B int +// } +// yaml.Marshal(&T{B: 2}) // Returns "b: 2\n" +// yaml.Marshal(&T{F: 1}} // Returns "a: 1\nb: 0\n" func Marshal(in interface{}) (out []byte, err error) { defer handleErr(&err) e := newEncoder() @@ -278,6 +275,16 @@ func (e *Encoder) SetIndent(spaces int) { e.encoder.indent = spaces } +// CompactSeqIndent makes it so that '- ' is considered part of the indentation. +func (e *Encoder) CompactSeqIndent() { + e.encoder.emitter.compact_sequence_indent = true +} + +// DefaultSeqIndent makes it so that '- ' is not considered part of the indentation. +func (e *Encoder) DefaultSeqIndent() { + e.encoder.emitter.compact_sequence_indent = false +} + // Close closes the encoder by writing any remaining data. // It does not write a stream terminating string "...". func (e *Encoder) Close() (err error) { @@ -358,22 +365,21 @@ const ( // // For example: // -// var person struct { -// Name string -// Address yaml.Node -// } -// err := yaml.Unmarshal(data, &person) -// -// Or by itself: +// var person struct { +// Name string +// Address yaml.Node +// } +// err := yaml.Unmarshal(data, &person) // -// var person Node -// err := yaml.Unmarshal(data, &person) +// Or by itself: // +// var person Node +// err := yaml.Unmarshal(data, &person) type Node struct { // Kind defines whether the node is a document, a mapping, a sequence, // a scalar value, or an alias to another node. The specific data type of // scalar nodes may be obtained via the ShortTag and LongTag methods. - Kind Kind + Kind Kind // Style allows customizing the apperance of the node in the tree. Style Style @@ -421,7 +427,6 @@ func (n *Node) IsZero() bool { n.HeadComment == "" && n.LineComment == "" && n.FootComment == "" && n.Line == 0 && n.Column == 0 } - // LongTag returns the long form of the tag that indicates the data type for // the node. If the Tag field isn't explicitly defined, one will be computed // based on the node properties. diff --git a/vendor/gopkg.in/yaml.v3/yamlh.go b/vendor/go.yaml.in/yaml/v3/yamlh.go similarity index 95% rename from vendor/gopkg.in/yaml.v3/yamlh.go rename to vendor/go.yaml.in/yaml/v3/yamlh.go index 7c6d0077..07c44236 100644 --- a/vendor/gopkg.in/yaml.v3/yamlh.go +++ b/vendor/go.yaml.in/yaml/v3/yamlh.go @@ -433,19 +433,19 @@ type yaml_document_t struct { // The prototype of a read handler. // -// The read handler is called when the parser needs to read more bytes from the -// source. The handler should write not more than size bytes to the buffer. -// The number of written bytes should be set to the size_read variable. +// The read handler is called when the parser needs to read more bytes from the +// source. The handler should write not more than size bytes to the buffer. +// The number of written bytes should be set to the size_read variable. // -// [in,out] data A pointer to an application data specified by -// yaml_parser_set_input(). -// [out] buffer The buffer to write the data from the source. -// [in] size The size of the buffer. -// [out] size_read The actual number of bytes read from the source. +// [in,out] data A pointer to an application data specified by +// yaml_parser_set_input(). +// [out] buffer The buffer to write the data from the source. +// [in] size The size of the buffer. +// [out] size_read The actual number of bytes read from the source. // -// On success, the handler should return 1. If the handler failed, -// the returned value should be 0. On EOF, the handler should set the -// size_read to 0 and return 1. +// On success, the handler should return 1. If the handler failed, +// the returned value should be 0. On EOF, the handler should set the +// size_read to 0 and return 1. type yaml_read_handler_t func(parser *yaml_parser_t, buffer []byte) (n int, err error) // This structure holds information about a potential simple key. @@ -639,7 +639,6 @@ type yaml_parser_t struct { } type yaml_comment_t struct { - scan_mark yaml_mark_t // Position where scanning for comments started token_mark yaml_mark_t // Position after which tokens will be associated with this comment start_mark yaml_mark_t // Position of '#' comment mark @@ -654,18 +653,17 @@ type yaml_comment_t struct { // The prototype of a write handler. // -// The write handler is called when the emitter needs to flush the accumulated -// characters to the output. The handler should write @a size bytes of the -// @a buffer to the output. -// -// @param[in,out] data A pointer to an application data specified by -// yaml_emitter_set_output(). -// @param[in] buffer The buffer with bytes to be written. -// @param[in] size The size of the buffer. +// The write handler is called when the emitter needs to flush the accumulated +// characters to the output. The handler should write @a size bytes of the +// @a buffer to the output. // -// @returns On success, the handler should return @c 1. If the handler failed, -// the returned value should be @c 0. +// @param[in,out] data A pointer to an application data specified by +// yaml_emitter_set_output(). +// @param[in] buffer The buffer with bytes to be written. +// @param[in] size The size of the buffer. // +// @returns On success, the handler should return @c 1. If the handler failed, +// the returned value should be @c 0. type yaml_write_handler_t func(emitter *yaml_emitter_t, buffer []byte) error type yaml_emitter_state_t int @@ -742,6 +740,8 @@ type yaml_emitter_t struct { indent int // The current indentation level. + compact_sequence_indent bool // Is '- ' is considered part of the indentation for sequence elements? + flow_level int // The current flow level. root_context bool // Is it the document root context? diff --git a/vendor/gopkg.in/yaml.v3/yamlprivateh.go b/vendor/go.yaml.in/yaml/v3/yamlprivateh.go similarity index 97% rename from vendor/gopkg.in/yaml.v3/yamlprivateh.go rename to vendor/go.yaml.in/yaml/v3/yamlprivateh.go index e88f9c54..dea1ba96 100644 --- a/vendor/gopkg.in/yaml.v3/yamlprivateh.go +++ b/vendor/go.yaml.in/yaml/v3/yamlprivateh.go @@ -1,17 +1,17 @@ -// +// // Copyright (c) 2011-2019 Canonical Ltd // Copyright (c) 2006-2010 Kirill Simonov -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies // of the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -137,8 +137,8 @@ func is_crlf(b []byte, i int) bool { func is_breakz(b []byte, i int) bool { //return is_break(b, i) || is_z(b, i) return ( - // is_break: - b[i] == '\r' || // CR (#xD) + // is_break: + b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85) b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028) @@ -151,8 +151,8 @@ func is_breakz(b []byte, i int) bool { func is_spacez(b []byte, i int) bool { //return is_space(b, i) || is_breakz(b, i) return ( - // is_space: - b[i] == ' ' || + // is_space: + b[i] == ' ' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) @@ -166,8 +166,8 @@ func is_spacez(b []byte, i int) bool { func is_blankz(b []byte, i int) bool { //return is_blank(b, i) || is_breakz(b, i) return ( - // is_blank: - b[i] == ' ' || b[i] == '\t' || + // is_blank: + b[i] == ' ' || b[i] == '\t' || // is_breakz: b[i] == '\r' || // CR (#xD) b[i] == '\n' || // LF (#xA) diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go index 3ea47038..acd6257f 100644 --- a/vendor/golang.org/x/sys/unix/affinity_linux.go +++ b/vendor/golang.org/x/sys/unix/affinity_linux.go @@ -13,11 +13,19 @@ import ( const cpuSetSize = _CPU_SETSIZE / _NCPUBITS -// CPUSet represents a CPU affinity mask. +// CPUSet represents a bit mask of CPUs, to be used with [SchedGetaffinity], [SchedSetaffinity], +// and [SetMemPolicy]. +// +// Note this type can only represent CPU IDs 0 through 1023. +// Use [CPUSetDynamic]/[NewCPUSet] instead to avoid this limit. type CPUSet [cpuSetSize]cpuMask -func schedAffinity(trap uintptr, pid int, set *CPUSet) error { - _, _, e := RawSyscall(trap, uintptr(pid), uintptr(unsafe.Sizeof(*set)), uintptr(unsafe.Pointer(set))) +// CPUSetDynamic represents a bit mask of CPUs, to be used with [SchedGetaffinityDynamic], +// [SchedSetaffinityDynamic], and [SetMemPolicyDynamic]. Use [NewCPUSet] to allocate. +type CPUSetDynamic []cpuMask + +func schedAffinity(trap uintptr, pid int, size uintptr, ptr unsafe.Pointer) error { + _, _, e := RawSyscall(trap, uintptr(pid), uintptr(size), uintptr(ptr)) if e != 0 { return errnoErr(e) } @@ -27,13 +35,13 @@ func schedAffinity(trap uintptr, pid int, set *CPUSet) error { // SchedGetaffinity gets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedGetaffinity(pid int, set *CPUSet) error { - return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set) + return schedAffinity(SYS_SCHED_GETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set)) } // SchedSetaffinity sets the CPU affinity mask of the thread specified by pid. // If pid is 0 the calling thread is used. func SchedSetaffinity(pid int, set *CPUSet) error { - return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set) + return schedAffinity(SYS_SCHED_SETAFFINITY, pid, unsafe.Sizeof(*set), unsafe.Pointer(set)) } // Zero clears the set s, so that it contains no CPUs. @@ -45,9 +53,7 @@ func (s *CPUSet) Zero() { // will silently ignore any invalid CPU bits in [CPUSet] so this is an // efficient way of resetting the CPU affinity of a process. func (s *CPUSet) Fill() { - for i := range s { - s[i] = ^cpuMask(0) - } + cpuMaskFill(s[:]) } func cpuBitsIndex(cpu int) int { @@ -58,24 +64,27 @@ func cpuBitsMask(cpu int) cpuMask { return cpuMask(1 << (uint(cpu) % _NCPUBITS)) } -// Set adds cpu to the set s. -func (s *CPUSet) Set(cpu int) { +func cpuMaskFill(s []cpuMask) { + for i := range s { + s[i] = ^cpuMask(0) + } +} + +func cpuMaskSet(s []cpuMask, cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] |= cpuBitsMask(cpu) } } -// Clear removes cpu from the set s. -func (s *CPUSet) Clear(cpu int) { +func cpuMaskClear(s []cpuMask, cpu int) { i := cpuBitsIndex(cpu) if i < len(s) { s[i] &^= cpuBitsMask(cpu) } } -// IsSet reports whether cpu is in the set s. -func (s *CPUSet) IsSet(cpu int) bool { +func cpuMaskIsSet(s []cpuMask, cpu int) bool { i := cpuBitsIndex(cpu) if i < len(s) { return s[i]&cpuBitsMask(cpu) != 0 @@ -83,11 +92,98 @@ func (s *CPUSet) IsSet(cpu int) bool { return false } -// Count returns the number of CPUs in the set s. -func (s *CPUSet) Count() int { +func cpuMaskCount(s []cpuMask) int { c := 0 for _, b := range s { c += bits.OnesCount64(uint64(b)) } return c } + +// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken. +func (s *CPUSet) Set(cpu int) { + cpuMaskSet(s[:], cpu) +} + +// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken. +func (s *CPUSet) Clear(cpu int) { + cpuMaskClear(s[:], cpu) +} + +// IsSet reports whether cpu is in the set s. +func (s *CPUSet) IsSet(cpu int) bool { + return cpuMaskIsSet(s[:], cpu) +} + +// Count returns the number of CPUs in the set s. +func (s *CPUSet) Count() int { + return cpuMaskCount(s[:]) +} + +// NewCPUSet creates a CPU affinity mask capable of representing CPU IDs +// up to maxCPU (exclusive). +func NewCPUSet(maxCPU int) CPUSetDynamic { + numMasks := (maxCPU + _NCPUBITS - 1) / _NCPUBITS + if numMasks == 0 { + numMasks = 1 + } + return make(CPUSetDynamic, numMasks) +} + +// Zero clears the set s, so that it contains no CPUs. +func (s CPUSetDynamic) Zero() { + clear(s) +} + +// Fill adds all possible CPU bits to the set s. On Linux, [SchedSetaffinityDynamic] +// will silently ignore any invalid CPU bits in [CPUSetDynamic] so this is an +// efficient way of resetting the CPU affinity of a process. +func (s CPUSetDynamic) Fill() { + cpuMaskFill(s) +} + +// Set adds cpu to the set s. If cpu is out of bounds for s, no action is taken. +func (s CPUSetDynamic) Set(cpu int) { + cpuMaskSet(s, cpu) +} + +// Clear removes cpu from the set s. If cpu is out of bounds for s, no action is taken. +func (s CPUSetDynamic) Clear(cpu int) { + cpuMaskClear(s, cpu) +} + +// IsSet reports whether cpu is in the set s. +func (s CPUSetDynamic) IsSet(cpu int) bool { + return cpuMaskIsSet(s, cpu) +} + +// Count returns the number of CPUs in the set s. +func (s CPUSetDynamic) Count() int { + return cpuMaskCount(s) +} + +func (s CPUSetDynamic) size() uintptr { + return uintptr(len(s)) * unsafe.Sizeof(cpuMask(0)) +} + +func (s CPUSetDynamic) pointer() unsafe.Pointer { + if len(s) == 0 { + return nil + } + return unsafe.Pointer(&s[0]) +} + +// SchedGetaffinityDynamic gets the CPU affinity mask of the thread specified by pid. +// If pid is 0 the calling thread is used. +// +// If the set is smaller than the size of the affinity mask used by the kernel, +// [EINVAL] is returned. +func SchedGetaffinityDynamic(pid int, set CPUSetDynamic) error { + return schedAffinity(SYS_SCHED_GETAFFINITY, pid, set.size(), set.pointer()) +} + +// SchedSetaffinityDynamic sets the CPU affinity mask of the thread specified by pid. +// If pid is 0 the calling thread is used. +func SchedSetaffinityDynamic(pid int, set CPUSetDynamic) error { + return schedAffinity(SYS_SCHED_SETAFFINITY, pid, set.size(), set.pointer()) +} diff --git a/vendor/golang.org/x/sys/unix/mkall.sh b/vendor/golang.org/x/sys/unix/mkall.sh index d0ed6119..f6ddee1a 100644 --- a/vendor/golang.org/x/sys/unix/mkall.sh +++ b/vendor/golang.org/x/sys/unix/mkall.sh @@ -51,7 +51,7 @@ if [[ "$GOOS" = "linux" ]]; then # Files generated through docker (use $cmd so you can Ctl-C the build or run) set -e $cmd docker build --tag generate:$GOOS $GOOS - $cmd docker run --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS + $cmd docker run --rm --interactive --tty --volume $(cd -- "$(dirname -- "$0")/.." && pwd):/build generate:$GOOS exit fi diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index fd39be4e..fa74cfe9 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -354,6 +354,9 @@ struct ltchars { // Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") #define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME #define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION + +// Removed in v6.17, commit 760e6f7befba ("futex: Remove support for IMMUTABLE") +#define PR_FUTEX_HASH_GET_IMMUTABLE 3 ' includes_NetBSD=' diff --git a/vendor/golang.org/x/sys/unix/readv_unix.go b/vendor/golang.org/x/sys/unix/readv_unix.go new file mode 100644 index 00000000..38a2be93 --- /dev/null +++ b/vendor/golang.org/x/sys/unix/readv_unix.go @@ -0,0 +1,103 @@ +// Copyright 2026 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 || linux || openbsd + +package unix + +import "unsafe" + +// 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) <= minIovec 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 { + v.Base = &b[0] + } else { + v.Base = (*byte)(unsafe.Pointer(&_zero)) + } + vecs = append(vecs, v) + } + return vecs +} + +// writevRaceDetect tells the race detector that the program +// has read the first n bytes stored in iovecs. +func writevRaceDetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := min(int(iovecs[i].Len), n) + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} + +// readvRaceDetect tells the race detector that the program +// has written to the first n bytes stored in iovecs. +func readvRaceDetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := min(int(iovecs[i].Len), n) + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + +func Readv(fd int, iovs [][]byte) (n int, err error) { + 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 := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = preadv(fd, iovecs, offset) + readvRaceDetect(iovecs, n, err) + return n, err +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRaceDetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwritev(fd, iovecs, offset) + writevRaceDetect(iovecs, n) + return n, err +} diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 7838ca5d..38590ca8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,95 +602,6 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } -const minIovec = 8 - -func Readv(fd int, iovs [][]byte) (n int, err error) { - 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 := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - n, err = preadv(fd, iovecs, offset) - readvRacedetect(iovecs, n, err) - return n, err -} - -func Writev(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = writev(fd, iovecs) - writevRacedetect(iovecs, n) - return n, err -} - -func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = pwritev(fd, iovecs, offset) - writevRacedetect(iovecs, n) - return n, err -} - -func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { - for _, b := range bs { - var v Iovec - v.SetLen(len(b)) - if len(b) > 0 { - v.Base = &b[0] - } else { - v.Base = (*byte)(unsafe.Pointer(&_zero)) - } - vecs = append(vecs, v) - } - return vecs -} - -func writevRacedetect(iovecs []Iovec, n int) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } - n -= m - if m > 0 { - raceReadRange(unsafe.Pointer(iovecs[i].Base), m) - } - } -} - -func readvRacedetect(iovecs []Iovec, n int, err error) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } - n -= m - if m > 0 { - raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) - } - } - if err == nil { - raceAcquire(unsafe.Pointer(&ioSync)) - } -} - //sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 06c0eea6..21e2bfa3 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -1874,6 +1874,7 @@ func Dup2(oldfd, newfd int) error { //sys Dup3(oldfd int, newfd int, flags int) (err error) //sysnb EpollCreate1(flag int) (fd int, err error) //sysnb EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) +//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) = SYS_EPOLL_PWAIT //sys Eventfd(initval uint, flags int) (fd int, err error) = SYS_EVENTFD2 //sys Exit(code int) = SYS_EXIT_GROUP //sys Fallocate(fd int, mode uint32, off int64, len int64) (err error) @@ -2150,33 +2151,10 @@ func Signalfd(fd int, sigmask *Sigset_t, flags int) (newfd int, err error) { //sys exitThread(code int) (err error) = SYS_EXIT //sys readv(fd int, iovs []Iovec) (n int, err error) = SYS_READV //sys writev(fd int, iovs []Iovec) (n int, err error) = SYS_WRITEV -//sys preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV -//sys pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV -//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 - -// 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 { - v.Base = &b[0] - } else { - v.Base = (*byte)(unsafe.Pointer(&_zero)) - } - vecs = append(vecs, v) - } - return vecs -} +//sys preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PREADV +//sys pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) = SYS_PWRITEV +//sys preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PREADV2 +//sys pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) = SYS_PWRITEV2 // offs2lohi splits offs into its low and high order bits. func offs2lohi(offs int64) (lo, hi uintptr) { @@ -2184,69 +2162,23 @@ func offs2lohi(offs int64) (lo, hi uintptr) { return uintptr(offs), uintptr(uint64(offs) >> (longBits - 1) >> 1) // two shifts to avoid false positive in vet } -func Readv(fd int, iovs [][]byte) (n int, err error) { - 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 := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { lo, hi := offs2lohi(offset) - n, err = preadv(fd, iovecs, lo, hi) - readvRacedetect(iovecs, n, err) - return n, err + return preadvSyscall(fd, iovecs, lo, hi) } func Preadv2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { 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) - return n, err -} - -func readvRacedetect(iovecs []Iovec, n int, err error) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := min(int(iovecs[i].Len), n) - n -= m - if m > 0 { - raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) - } - } - if err == nil { - raceAcquire(unsafe.Pointer(&ioSync)) - } -} - -func Writev(fd int, iovs [][]byte) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } - n, err = writev(fd, iovecs) - writevRacedetect(iovecs, n) + n, err = preadv2Syscall(fd, iovecs, lo, hi, flags) + readvRaceDetect(iovecs, n, err) return n, err } -func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { - iovecs := make([]Iovec, 0, minIovec) - iovecs = appendBytes(iovecs, iovs) - if raceenabled { - raceReleaseMerge(unsafe.Pointer(&ioSync)) - } +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { lo, hi := offs2lohi(offset) - n, err = pwritev(fd, iovecs, lo, hi) - writevRacedetect(iovecs, n) - return n, err + return pwritevSyscall(fd, iovecs, lo, hi) } func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) { @@ -2256,24 +2188,11 @@ func Pwritev2(fd int, iovs [][]byte, offset int64, flags int) (n int, err error) raceReleaseMerge(unsafe.Pointer(&ioSync)) } lo, hi := offs2lohi(offset) - n, err = pwritev2(fd, iovecs, lo, hi, flags) - writevRacedetect(iovecs, n) + n, err = pwritev2Syscall(fd, iovecs, lo, hi, flags) + writevRaceDetect(iovecs, n) return n, err } -func writevRacedetect(iovecs []Iovec, n int) { - if !raceenabled { - return - } - for i := 0; n > 0 && i < len(iovecs); i++ { - m := min(int(iovecs[i].Len), n) - n -= m - if m > 0 { - raceReadRange(unsafe.Pointer(iovecs[i].Base), m) - } - } -} - // mmap varies by architecture; see syscall_linux_*.go. //sys munmap(addr uintptr, length uintptr) (err error) //sys mremap(oldaddr uintptr, oldlength uintptr, newlength uintptr, flags int, newaddr uintptr) (xaddr uintptr, err error) @@ -2644,8 +2563,12 @@ func SchedGetAttr(pid int, flags uint) (*SchedAttr, error) { //sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) //sys Mseal(b []byte, flags uint) (err error) -//sys setMemPolicy(mode int, mask *CPUSet, size int) (err error) = SYS_SET_MEMPOLICY +//sys setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) = SYS_SET_MEMPOLICY func SetMemPolicy(mode int, mask *CPUSet) error { - return setMemPolicy(mode, mask, _CPU_SETSIZE) + return setMemPolicy(mode, unsafe.Pointer(mask), _CPU_SETSIZE) +} + +func SetMemPolicyDynamic(mode int, mask CPUSetDynamic) error { + return setMemPolicy(mode, mask.pointer(), mask.size()) } 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 506dafa7..210d545c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_386.go @@ -20,7 +20,6 @@ func setTimeval(sec, usec int64) Timeval { // 64-bit file system and 32-bit uid calls // (386 default is 32-bit file system and 16-bit uid). -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fadvise(fd int, offset int64, length int64, advice int) (err error) = SYS_FADVISE64_64 //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 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 d557cf8d..a9a52f23 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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 Fstat(fd int, stat *Stat_t) (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 cd2dd797..54474c20 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm.go @@ -44,7 +44,6 @@ func Seek(fd int, offset int64, whence int) (newoffset int64, err error) { // 64-bit file system and 32-bit uid calls // (16-bit uid calls are not always supported in newer kernels) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) = SYS_FCHOWN32 //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 @@ -82,6 +81,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, 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 745e5c7e..e9f30db9 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go @@ -8,7 +8,6 @@ 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 Fstat(fd int, stat *Stat_t) (err error) @@ -113,6 +112,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, diff --git a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go index dd2262a4..6f09ca20 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go @@ -8,7 +8,6 @@ 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) @@ -150,6 +149,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, 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 70963a95..ca3b5659 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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) 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 c218ebd2..54ba667b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go @@ -13,7 +13,6 @@ import ( func Syscall9(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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 Ftruncate(fd int, length int64) (err error) = SYS_FTRUNCATE64 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 e6c48500..ce462859 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go @@ -11,7 +11,6 @@ import ( "unsafe" ) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //sys Fchown(fd int, uid int, gid int) (err error) //sys Fstat(fd int, stat *Stat_t) (err error) = SYS_FSTAT64 //sys Fstatat(dirfd int, path string, stat *Stat_t, flags int) (err error) = SYS_FSTATAT64 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 7286a9aa..33f7af38 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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 Fstat(fd int, stat *Stat_t) (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 8cf3670b..c658871e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go @@ -8,7 +8,6 @@ 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 Fstat(fd int, stat *Stat_t) (err error) @@ -112,6 +111,9 @@ func Time(t *Time_t) (Time_t, error) { } func Utime(path string, buf *Utimbuf) error { + if buf == nil { + return Utimes(path, nil) + } tv := []Timeval{ {Sec: buf.Actime}, {Sec: buf.Modtime}, 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 66f31210..2c858769 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go @@ -10,7 +10,6 @@ import ( "unsafe" ) -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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 Fstat(fd int, stat *Stat_t) (err error) 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 11d1f169..4964119a 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go @@ -6,7 +6,6 @@ package unix -//sys EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) //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 Fstat(fd int, stat *Stat_t) (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 b86ded54..7b0ef8e1 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -300,6 +300,10 @@ func Uname(uname *Utsname) 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 readv(fd int, iovecs []Iovec) (n int, err error) +//sys writev(fd int, iovecs []Iovec) (n int, err error) +//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) +//sys pwritev(fd int, iovecs []Iovec, 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/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 120a7b35..5bb51d7a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -353,8 +353,10 @@ const ( AUDIT_MAC_IPSEC_EVENT = 0x587 AUDIT_MAC_MAP_ADD = 0x581 AUDIT_MAC_MAP_DEL = 0x582 + AUDIT_MAC_OBJ_CONTEXTS = 0x592 AUDIT_MAC_POLICY_LOAD = 0x57b AUDIT_MAC_STATUS = 0x57c + AUDIT_MAC_TASK_CONTEXTS = 0x591 AUDIT_MAC_UNLBL_ALLOW = 0x57e AUDIT_MAC_UNLBL_STCADD = 0x588 AUDIT_MAC_UNLBL_STCDEL = 0x589 @@ -591,8 +593,13 @@ const ( CAN_CTRLMODE_LOOPBACK = 0x1 CAN_CTRLMODE_ONE_SHOT = 0x8 CAN_CTRLMODE_PRESUME_ACK = 0x40 + CAN_CTRLMODE_RESTRICTED = 0x800 CAN_CTRLMODE_TDC_AUTO = 0x200 CAN_CTRLMODE_TDC_MANUAL = 0x400 + CAN_CTRLMODE_XL = 0x1000 + CAN_CTRLMODE_XL_TDC_AUTO = 0x2000 + CAN_CTRLMODE_XL_TDC_MANUAL = 0x4000 + CAN_CTRLMODE_XL_TMS = 0x8000 CAN_EFF_FLAG = 0x80000000 CAN_EFF_ID_BITS = 0x1d CAN_EFF_MASK = 0x1fffffff @@ -800,6 +807,8 @@ const ( DEVLINK_PORT_FN_CAP_IPSEC_PACKET = 0x8 DEVLINK_PORT_FN_CAP_MIGRATABLE = 0x2 DEVLINK_PORT_FN_CAP_ROCE = 0x1 + DEVLINK_RATE_TCS_MAX = 0x8 + DEVLINK_RATE_TC_INDEX_MAX = 0x7 DEVLINK_SB_THRESHOLD_TO_ALPHA_MAX = 0x14 DEVLINK_SUPPORTED_FLASH_OVERWRITE_SECTIONS = 0x3 DEVMEM_MAGIC = 0x454d444d @@ -1186,6 +1195,7 @@ const ( ETH_P_MPLS_UC = 0x8847 ETH_P_MRP = 0x88e3 ETH_P_MVRP = 0x88f5 + ETH_P_MXLGSW = 0x88c3 ETH_P_NCSI = 0x88f8 ETH_P_NSH = 0x894f ETH_P_PAE = 0x888e @@ -1218,6 +1228,7 @@ const ( ETH_P_WCCP = 0x883e ETH_P_X25 = 0x805 ETH_P_XDSA = 0xf8 + ETH_P_YT921X = 0x9988 ET_CORE = 0x4 ET_DYN = 0x3 ET_EXEC = 0x2 @@ -1258,6 +1269,7 @@ const ( FALLOC_FL_NO_HIDE_STALE = 0x4 FALLOC_FL_PUNCH_HOLE = 0x2 FALLOC_FL_UNSHARE_RANGE = 0x40 + FALLOC_FL_WRITE_ZEROES = 0x80 FALLOC_FL_ZERO_RANGE = 0x10 FANOTIFY_METADATA_VERSION = 0x3 FAN_ACCESS = 0x1 @@ -1347,6 +1359,7 @@ const ( FAN_UNLIMITED_MARKS = 0x20 FAN_UNLIMITED_QUEUE = 0x10 FD_CLOEXEC = 0x1 + FD_PIDFS_ROOT = -0x2712 FD_SETSIZE = 0x400 FF0 = 0x0 FIB_RULE_DEV_DETACHED = 0x8 @@ -1477,6 +1490,7 @@ const ( GRND_INSECURE = 0x4 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 + GUEST_MEMFD_MAGIC = 0x474d454d HDIO_DRIVE_CMD = 0x31f HDIO_DRIVE_CMD_AEB = 0x31e HDIO_DRIVE_CMD_HDR_SIZE = 0x4 @@ -1517,6 +1531,7 @@ const ( HDIO_SET_XFER = 0x306 HDIO_TRISTATE_HWIF = 0x31b HDIO_UNREGISTER_HWIF = 0x32a + HIDIOCTL_LAST = 0xd HID_MAX_DESCRIPTOR_SIZE = 0x1000 HOSTFS_SUPER_MAGIC = 0xc0ffee HPFS_SUPER_MAGIC = 0xf995e849 @@ -1809,6 +1824,8 @@ const ( KEXEC_ARCH_X86_64 = 0x3e0000 KEXEC_CRASH_HOTPLUG_SUPPORT = 0x8 KEXEC_FILE_DEBUG = 0x8 + KEXEC_FILE_FORCE_DTB = 0x20 + KEXEC_FILE_NO_CMA = 0x10 KEXEC_FILE_NO_INITRAMFS = 0x4 KEXEC_FILE_ON_CRASH = 0x2 KEXEC_FILE_UNLOAD = 0x1 @@ -1905,6 +1922,7 @@ const ( LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 + LANDLOCK_RESTRICT_SELF_TSYNC = 0x8 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 @@ -1953,6 +1971,8 @@ const ( MADV_DONTNEED = 0x4 MADV_DONTNEED_LOCKED = 0x18 MADV_FREE = 0x8 + MADV_GUARD_INSTALL = 0x66 + MADV_GUARD_REMOVE = 0x67 MADV_HUGEPAGE = 0xe MADV_HWPOISON = 0x64 MADV_KEEPONFORK = 0x13 @@ -2097,7 +2117,7 @@ const ( MS_NOSEC = 0x10000000 MS_NOSUID = 0x2 MS_NOSYMFOLLOW = 0x100 - MS_NOUSER = -0x80000000 + MS_NOUSER = 0x80000000 MS_POSIXACL = 0x10000 MS_PRIVATE = 0x40000 MS_RDONLY = 0x1 @@ -2412,6 +2432,7 @@ const ( NN_PRXFPREG = "LINUX" NN_RISCV_CSR = "LINUX" NN_RISCV_TAGGED_ADDR_CTRL = "LINUX" + NN_RISCV_USER_CFI = "LINUX" NN_RISCV_VECTOR = "LINUX" NN_S390_CTRS = "LINUX" NN_S390_GS_BC = "LINUX" @@ -2493,6 +2514,7 @@ const ( NT_PRXFPREG = 0x46e62b7f NT_RISCV_CSR = 0x900 NT_RISCV_TAGGED_ADDR_CTRL = 0x902 + NT_RISCV_USER_CFI = 0x903 NT_RISCV_VECTOR = 0x901 NT_S390_CTRS = 0x304 NT_S390_GS_BC = 0x30c @@ -2515,6 +2537,7 @@ const ( NT_X86_SHSTK = 0x204 NT_X86_XSAVE_LAYOUT = 0x205 NT_X86_XSTATE = 0x202 + NULL_FS_MAGIC = 0x4e554c4c OCFS2_SUPER_MAGIC = 0x7461636f OCRNL = 0x8 OFDEL = 0x80 @@ -2594,6 +2617,7 @@ const ( PERF_ATTR_SIZE_VER6 = 0x78 PERF_ATTR_SIZE_VER7 = 0x80 PERF_ATTR_SIZE_VER8 = 0x88 + PERF_ATTR_SIZE_VER9 = 0x90 PERF_AUX_FLAG_COLLISION = 0x8 PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT = 0x0 PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW = 0x100 @@ -2629,6 +2653,7 @@ const ( PERF_MEM_LVLNUM_ANY_CACHE = 0xb PERF_MEM_LVLNUM_CXL = 0x9 PERF_MEM_LVLNUM_IO = 0xa + PERF_MEM_LVLNUM_L0 = 0x7 PERF_MEM_LVLNUM_L1 = 0x1 PERF_MEM_LVLNUM_L2 = 0x2 PERF_MEM_LVLNUM_L2_MHB = 0x5 @@ -2662,6 +2687,23 @@ const ( PERF_MEM_OP_PFETCH = 0x8 PERF_MEM_OP_SHIFT = 0x0 PERF_MEM_OP_STORE = 0x4 + PERF_MEM_REGION_L_NON_SHARE = 0x3 + PERF_MEM_REGION_L_SHARE = 0x2 + PERF_MEM_REGION_MEM0 = 0x8 + PERF_MEM_REGION_MEM1 = 0x9 + PERF_MEM_REGION_MEM2 = 0xa + PERF_MEM_REGION_MEM3 = 0xb + PERF_MEM_REGION_MEM4 = 0xc + PERF_MEM_REGION_MEM5 = 0xd + PERF_MEM_REGION_MEM6 = 0xe + PERF_MEM_REGION_MEM7 = 0xf + PERF_MEM_REGION_MMIO = 0x7 + PERF_MEM_REGION_NA = 0x0 + PERF_MEM_REGION_O_IO = 0x4 + PERF_MEM_REGION_O_NON_SHARE = 0x6 + PERF_MEM_REGION_O_SHARE = 0x5 + PERF_MEM_REGION_RSVD = 0x1 + PERF_MEM_REGION_SHIFT = 0x2e PERF_MEM_REMOTE_REMOTE = 0x1 PERF_MEM_REMOTE_SHIFT = 0x25 PERF_MEM_SNOOPX_FWD = 0x1 @@ -2776,6 +2818,10 @@ const ( PR_CAP_AMBIENT_IS_SET = 0x1 PR_CAP_AMBIENT_LOWER = 0x3 PR_CAP_AMBIENT_RAISE = 0x2 + PR_CFI_BRANCH_LANDING_PADS = 0x0 + PR_CFI_DISABLE = 0x2 + PR_CFI_ENABLE = 0x1 + PR_CFI_LOCK = 0x4 PR_ENDIAN_BIG = 0x0 PR_ENDIAN_LITTLE = 0x1 PR_ENDIAN_PPC_LITTLE = 0x2 @@ -2798,6 +2844,7 @@ const ( PR_FUTEX_HASH_GET_SLOTS = 0x2 PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 + PR_GET_CFI = 0x50 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 PR_GET_ENDIAN = 0x13 @@ -2834,6 +2881,7 @@ const ( PR_MDWE_REFUSE_EXEC_GAIN = 0x1 PR_MPX_DISABLE_MANAGEMENT = 0x2c PR_MPX_ENABLE_MANAGEMENT = 0x2b + PR_MTE_STORE_ONLY = 0x80000 PR_MTE_TAG_MASK = 0x7fff8 PR_MTE_TAG_SHIFT = 0x3 PR_MTE_TCF_ASYNC = 0x4 @@ -2877,6 +2925,10 @@ const ( PR_RISCV_V_VSTATE_CTRL_NEXT_MASK = 0xc PR_RISCV_V_VSTATE_CTRL_OFF = 0x1 PR_RISCV_V_VSTATE_CTRL_ON = 0x2 + PR_RSEQ_SLICE_EXTENSION = 0x4f + PR_RSEQ_SLICE_EXTENSION_GET = 0x1 + PR_RSEQ_SLICE_EXTENSION_SET = 0x2 + PR_RSEQ_SLICE_EXT_ENABLE = 0x1 PR_SCHED_CORE = 0x3e PR_SCHED_CORE_CREATE = 0x1 PR_SCHED_CORE_GET = 0x0 @@ -2886,6 +2938,7 @@ const ( PR_SCHED_CORE_SCOPE_THREAD_GROUP = 0x1 PR_SCHED_CORE_SHARE_FROM = 0x3 PR_SCHED_CORE_SHARE_TO = 0x2 + PR_SET_CFI = 0x51 PR_SET_CHILD_SUBREAPER = 0x24 PR_SET_DUMPABLE = 0x4 PR_SET_ENDIAN = 0x14 @@ -2951,11 +3004,14 @@ const ( PR_SVE_SET_VL_ONEXEC = 0x40000 PR_SVE_VL_INHERIT = 0x20000 PR_SVE_VL_LEN_MASK = 0xffff + PR_SYS_DISPATCH_EXCLUSIVE_ON = 0x1 + PR_SYS_DISPATCH_INCLUSIVE_ON = 0x2 PR_SYS_DISPATCH_OFF = 0x0 PR_SYS_DISPATCH_ON = 0x1 PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_THP_DISABLE_EXCEPT_ADVISED = 0x2 PR_TIMER_CREATE_RESTORE_IDS = 0x4d PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 @@ -2987,8 +3043,10 @@ const ( PTP_STRICT_FLAGS = 0x8 PTP_SYS_OFFSET_EXTENDED = 0xc4c03d09 PTP_SYS_OFFSET_EXTENDED2 = 0xc4c03d12 + PTP_SYS_OFFSET_EXTENDED_CYCLES = 0xc4c03d16 PTP_SYS_OFFSET_PRECISE = 0xc0403d08 PTP_SYS_OFFSET_PRECISE2 = 0xc0403d11 + PTP_SYS_OFFSET_PRECISE_CYCLES = 0xc0403d15 PTRACE_ATTACH = 0x10 PTRACE_CONT = 0x7 PTRACE_DETACH = 0x11 @@ -3330,8 +3388,9 @@ const ( RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 + RWF_NOSIGNAL = 0x100 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0xff + RWF_SUPPORTED = 0x1ff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3714,7 +3773,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0x10 + TASKSTATS_VERSION = 0x11 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -3730,6 +3789,9 @@ const ( TCPOPT_TIMESTAMP = 0x8 TCPOPT_TSTAMP_HDR = 0x101080a TCPOPT_WINDOW = 0x3 + TCP_AO_KEYF_EXCLUDE_OPT = 0x2 + TCP_AO_KEYF_IFINDEX = 0x1 + TCP_AO_MAXKEYLEN = 0x50 TCP_CC_INFO = 0x1a TCP_CM_INQ = 0x24 TCP_CONGESTION = 0xd @@ -4052,6 +4114,7 @@ const ( XDP_FLAGS_REPLACE = 0x10 XDP_FLAGS_SKB_MODE = 0x2 XDP_FLAGS_UPDATE_IF_NOEXIST = 0x1 + XDP_MAX_TX_SKB_BUDGET = 0x9 XDP_MMAP_OFFSETS = 0x1 XDP_OPTIONS = 0x8 XDP_OPTIONS_ZEROCOPY = 0x1 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 97a61fc5..c0a8ea1d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -159,6 +159,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -305,6 +306,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -352,6 +354,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -596,6 +599,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -819,7 +824,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index a0d6d498..ff927c83 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -159,6 +159,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -306,6 +307,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -353,6 +355,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -596,6 +599,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -819,7 +824,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index dd9c903f..55294eda 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -311,6 +312,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -358,6 +360,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -601,6 +604,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -824,7 +829,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 384c61ca..5dac54c3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -161,6 +161,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -598,6 +601,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -821,7 +826,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 6384c983..46ac1fcb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -160,6 +160,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -298,6 +299,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -345,6 +347,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -588,6 +591,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -811,7 +816,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 553c1c6f..b55483e8 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index b3339f20..71890c98 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 177091d2..a78b6cc1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index c5abf156..d0e38ca7 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x20 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -304,6 +305,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -351,6 +353,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x2c @@ -597,6 +600,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x60) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x46d) + EFSBADCRC = syscall.Errno(0x4d) + EFSCORRUPTED = syscall.Errno(0x87) EHOSTDOWN = syscall.Errno(0x93) EHOSTUNREACH = syscall.Errno(0x94) EHWPOISON = syscall.Errno(0xa8) @@ -814,7 +819,7 @@ var errorList = [...]struct { {132, "ENOBUFS", "no buffer space available"}, {133, "EISCONN", "transport endpoint is already connected"}, {134, "ENOTCONN", "transport endpoint is not connected"}, - {135, "EUCLEAN", "structure needs cleaning"}, + {135, "EFSCORRUPTED", "structure needs cleaning"}, {137, "ENOTNAM", "not a XENIX named type file"}, {138, "ENAVAIL", "no XENIX semaphores available"}, {139, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index f1f3fadf..c883e14c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -359,6 +360,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -406,6 +408,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -653,6 +656,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -877,7 +882,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 203ad9c5..1834273d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -363,6 +364,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -410,6 +412,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -881,7 +886,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 4b9abcb2..39945dd9 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -158,6 +158,7 @@ const ( NL3 = 0x300 NLDLY = 0x300 NOFLSH = 0x80000000 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -363,6 +364,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -410,6 +412,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -881,7 +886,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index f8798303..bc0f3724 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -11,553 +11,569 @@ package unix import "syscall" const ( - B1000000 = 0x1008 - B115200 = 0x1002 - B1152000 = 0x1009 - B1500000 = 0x100a - B2000000 = 0x100b - B230400 = 0x1003 - B2500000 = 0x100c - B3000000 = 0x100d - B3500000 = 0x100e - B4000000 = 0x100f - B460800 = 0x1004 - B500000 = 0x1005 - B57600 = 0x1001 - B576000 = 0x1006 - B921600 = 0x1007 - BLKALIGNOFF = 0x127a - BLKBSZGET = 0x80081270 - BLKBSZSET = 0x40081271 - BLKDISCARD = 0x1277 - BLKDISCARDZEROES = 0x127c - BLKFLSBUF = 0x1261 - BLKFRAGET = 0x1265 - BLKFRASET = 0x1264 - BLKGETDISKSEQ = 0x80081280 - BLKGETSIZE = 0x1260 - BLKGETSIZE64 = 0x80081272 - BLKIOMIN = 0x1278 - BLKIOOPT = 0x1279 - BLKPBSZGET = 0x127b - BLKRAGET = 0x1263 - BLKRASET = 0x1262 - BLKROGET = 0x125e - BLKROSET = 0x125d - BLKROTATIONAL = 0x127e - BLKRRPART = 0x125f - BLKSECDISCARD = 0x127d - BLKSECTGET = 0x1267 - BLKSECTSET = 0x1266 - BLKSSZGET = 0x1268 - BLKZEROOUT = 0x127f - BOTHER = 0x1000 - BS1 = 0x2000 - BSDLY = 0x2000 - CBAUD = 0x100f - CBAUDEX = 0x1000 - CIBAUD = 0x100f0000 - CLOCAL = 0x800 - CR1 = 0x200 - CR2 = 0x400 - CR3 = 0x600 - CRDLY = 0x600 - CREAD = 0x80 - CS6 = 0x10 - CS7 = 0x20 - CS8 = 0x30 - CSIZE = 0x30 - CSTOPB = 0x40 - DM_MPATH_PROBE_PATHS = 0xfd12 - ECCGETLAYOUT = 0x81484d11 - ECCGETSTATS = 0x80104d12 - ECHOCTL = 0x200 - ECHOE = 0x10 - ECHOK = 0x20 - ECHOKE = 0x800 - ECHONL = 0x40 - ECHOPRT = 0x400 - EFD_CLOEXEC = 0x80000 - EFD_NONBLOCK = 0x800 - EPIOCGPARAMS = 0x80088a02 - EPIOCSPARAMS = 0x40088a01 - EPOLL_CLOEXEC = 0x80000 - EXTPROC = 0x10000 - FF1 = 0x8000 - FFDLY = 0x8000 - FICLONE = 0x40049409 - FICLONERANGE = 0x4020940d - FLUSHO = 0x1000 - FS_IOC_ENABLE_VERITY = 0x40806685 - FS_IOC_GETFLAGS = 0x80086601 - FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b - FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 - FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 - FS_IOC_SETFLAGS = 0x40086602 - FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 - F_GETLK = 0x5 - F_GETLK64 = 0x5 - F_GETOWN = 0x9 - F_RDLCK = 0x0 - F_SETLK = 0x6 - F_SETLK64 = 0x6 - F_SETLKW = 0x7 - F_SETLKW64 = 0x7 - F_SETOWN = 0x8 - F_UNLCK = 0x2 - F_WRLCK = 0x1 - HIDIOCGRAWINFO = 0x80084803 - HIDIOCGRDESC = 0x90044802 - HIDIOCGRDESCSIZE = 0x80044801 - HIDIOCREVOKE = 0x4004480d - HUPCL = 0x400 - ICANON = 0x2 - IEXTEN = 0x8000 - IN_CLOEXEC = 0x80000 - IN_NONBLOCK = 0x800 - IOCTL_MEI_NOTIFY_GET = 0x80044803 - IOCTL_MEI_NOTIFY_SET = 0x40044802 - IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 - IPV6_FLOWINFO_MASK = 0xffffff0f - IPV6_FLOWLABEL_MASK = 0xffff0f00 - ISIG = 0x1 - IUCLC = 0x200 - IXOFF = 0x1000 - IXON = 0x400 - MAP_ANON = 0x20 - MAP_ANONYMOUS = 0x20 - MAP_DENYWRITE = 0x800 - MAP_EXECUTABLE = 0x1000 - MAP_GROWSDOWN = 0x100 - MAP_HUGETLB = 0x40000 - MAP_LOCKED = 0x2000 - MAP_NONBLOCK = 0x10000 - MAP_NORESERVE = 0x4000 - MAP_POPULATE = 0x8000 - MAP_STACK = 0x20000 - MAP_SYNC = 0x80000 - MCL_CURRENT = 0x1 - MCL_FUTURE = 0x2 - MCL_ONFAULT = 0x4 - MEMERASE = 0x40084d02 - MEMERASE64 = 0x40104d14 - MEMGETBADBLOCK = 0x40084d0b - MEMGETINFO = 0x80204d01 - MEMGETOOBSEL = 0x80c84d0a - MEMGETREGIONCOUNT = 0x80044d07 - MEMISLOCKED = 0x80084d17 - MEMLOCK = 0x40084d05 - MEMREAD = 0xc0404d1a - MEMREADOOB = 0xc0104d04 - MEMSETBADBLOCK = 0x40084d0c - MEMUNLOCK = 0x40084d06 - MEMWRITEOOB = 0xc0104d03 - MTDFILEMODE = 0x4d13 - NFDBITS = 0x40 - NLDLY = 0x100 - NOFLSH = 0x80 - NS_GET_MNTNS_ID = 0x8008b705 - NS_GET_NSTYPE = 0xb703 - NS_GET_OWNER_UID = 0xb704 - NS_GET_PARENT = 0xb702 - NS_GET_PID_FROM_PIDNS = 0x8004b706 - NS_GET_PID_IN_PIDNS = 0x8004b708 - NS_GET_TGID_FROM_PIDNS = 0x8004b707 - NS_GET_TGID_IN_PIDNS = 0x8004b709 - NS_GET_USERNS = 0xb701 - OLCUC = 0x2 - ONLCR = 0x4 - OTPERASE = 0x400c4d19 - OTPGETREGIONCOUNT = 0x40044d0e - OTPGETREGIONINFO = 0x400c4d0f - OTPLOCK = 0x800c4d10 - OTPSELECT = 0x80044d0d - O_APPEND = 0x400 - O_ASYNC = 0x2000 - O_CLOEXEC = 0x80000 - O_CREAT = 0x40 - O_DIRECT = 0x4000 - O_DIRECTORY = 0x10000 - O_DSYNC = 0x1000 - O_EXCL = 0x80 - O_FSYNC = 0x101000 - O_LARGEFILE = 0x0 - O_NDELAY = 0x800 - O_NOATIME = 0x40000 - O_NOCTTY = 0x100 - O_NOFOLLOW = 0x20000 - O_NONBLOCK = 0x800 - O_PATH = 0x200000 - O_RSYNC = 0x101000 - O_SYNC = 0x101000 - O_TMPFILE = 0x410000 - O_TRUNC = 0x200 - PARENB = 0x100 - PARODD = 0x200 - PENDIN = 0x4000 - PERF_EVENT_IOC_DISABLE = 0x2401 - PERF_EVENT_IOC_ENABLE = 0x2400 - PERF_EVENT_IOC_ID = 0x80082407 - PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b - PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 - PERF_EVENT_IOC_PERIOD = 0x40082404 - PERF_EVENT_IOC_QUERY_BPF = 0xc008240a - PERF_EVENT_IOC_REFRESH = 0x2402 - PERF_EVENT_IOC_RESET = 0x2403 - PERF_EVENT_IOC_SET_BPF = 0x40042408 - PERF_EVENT_IOC_SET_FILTER = 0x40082406 - PERF_EVENT_IOC_SET_OUTPUT = 0x2405 - PPPIOCATTACH = 0x4004743d - PPPIOCATTCHAN = 0x40047438 - PPPIOCBRIDGECHAN = 0x40047435 - PPPIOCCONNECT = 0x4004743a - PPPIOCDETACH = 0x4004743c - PPPIOCDISCONN = 0x7439 - PPPIOCGASYNCMAP = 0x80047458 - PPPIOCGCHAN = 0x80047437 - PPPIOCGDEBUG = 0x80047441 - PPPIOCGFLAGS = 0x8004745a - PPPIOCGIDLE = 0x8010743f - PPPIOCGIDLE32 = 0x8008743f - PPPIOCGIDLE64 = 0x8010743f - PPPIOCGL2TPSTATS = 0x80487436 - PPPIOCGMRU = 0x80047453 - PPPIOCGRASYNCMAP = 0x80047455 - PPPIOCGUNIT = 0x80047456 - PPPIOCGXASYNCMAP = 0x80207450 - PPPIOCSACTIVE = 0x40107446 - PPPIOCSASYNCMAP = 0x40047457 - PPPIOCSCOMPRESS = 0x4010744d - PPPIOCSDEBUG = 0x40047440 - PPPIOCSFLAGS = 0x40047459 - PPPIOCSMAXCID = 0x40047451 - PPPIOCSMRRU = 0x4004743b - PPPIOCSMRU = 0x40047452 - PPPIOCSNPMODE = 0x4008744b - PPPIOCSPASS = 0x40107447 - PPPIOCSRASYNCMAP = 0x40047454 - PPPIOCSXASYNCMAP = 0x4020744f - PPPIOCUNBRIDGECHAN = 0x7434 - PPPIOCXFERUNIT = 0x744e - PR_SET_PTRACER_ANY = 0xffffffffffffffff - PTP_CLOCK_GETCAPS = 0x80503d01 - PTP_CLOCK_GETCAPS2 = 0x80503d0a - PTP_ENABLE_PPS = 0x40043d04 - PTP_ENABLE_PPS2 = 0x40043d0d - PTP_EXTTS_REQUEST = 0x40103d02 - PTP_EXTTS_REQUEST2 = 0x40103d0b - PTP_MASK_CLEAR_ALL = 0x3d13 - PTP_MASK_EN_SINGLE = 0x40043d14 - PTP_PEROUT_REQUEST = 0x40383d03 - PTP_PEROUT_REQUEST2 = 0x40383d0c - PTP_PIN_SETFUNC = 0x40603d07 - PTP_PIN_SETFUNC2 = 0x40603d10 - PTP_SYS_OFFSET = 0x43403d05 - PTP_SYS_OFFSET2 = 0x43403d0e - PTRACE_GETFDPIC = 0x21 - PTRACE_GETFDPIC_EXEC = 0x0 - PTRACE_GETFDPIC_INTERP = 0x1 - RLIMIT_AS = 0x9 - RLIMIT_MEMLOCK = 0x8 - RLIMIT_NOFILE = 0x7 - RLIMIT_NPROC = 0x6 - RLIMIT_RSS = 0x5 - RNDADDENTROPY = 0x40085203 - RNDADDTOENTCNT = 0x40045201 - RNDCLEARPOOL = 0x5206 - RNDGETENTCNT = 0x80045200 - RNDGETPOOL = 0x80085202 - RNDRESEEDCRNG = 0x5207 - RNDZAPENTCNT = 0x5204 - RTC_AIE_OFF = 0x7002 - RTC_AIE_ON = 0x7001 - RTC_ALM_READ = 0x80247008 - RTC_ALM_SET = 0x40247007 - RTC_EPOCH_READ = 0x8008700d - RTC_EPOCH_SET = 0x4008700e - RTC_IRQP_READ = 0x8008700b - RTC_IRQP_SET = 0x4008700c - RTC_PARAM_GET = 0x40187013 - RTC_PARAM_SET = 0x40187014 - RTC_PIE_OFF = 0x7006 - RTC_PIE_ON = 0x7005 - RTC_PLL_GET = 0x80207011 - RTC_PLL_SET = 0x40207012 - RTC_RD_TIME = 0x80247009 - RTC_SET_TIME = 0x4024700a - RTC_UIE_OFF = 0x7004 - RTC_UIE_ON = 0x7003 - RTC_VL_CLR = 0x7014 - RTC_VL_READ = 0x80047013 - RTC_WIE_OFF = 0x7010 - RTC_WIE_ON = 0x700f - RTC_WKALM_RD = 0x80287010 - RTC_WKALM_SET = 0x4028700f - SCM_DEVMEM_DMABUF = 0x4f - SCM_DEVMEM_LINEAR = 0x4e - SCM_TIMESTAMPING = 0x25 - SCM_TIMESTAMPING_OPT_STATS = 0x36 - SCM_TIMESTAMPING_PKTINFO = 0x3a - SCM_TIMESTAMPNS = 0x23 - SCM_TS_OPT_ID = 0x51 - SCM_TXTIME = 0x3d - SCM_WIFI_STATUS = 0x29 - SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 - SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 - SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 - SFD_CLOEXEC = 0x80000 - SFD_NONBLOCK = 0x800 - SIOCATMARK = 0x8905 - SIOCGPGRP = 0x8904 - SIOCGSTAMPNS_NEW = 0x80108907 - SIOCGSTAMP_NEW = 0x80108906 - SIOCINQ = 0x541b - SIOCOUTQ = 0x5411 - SIOCSPGRP = 0x8902 - SOCK_CLOEXEC = 0x80000 - SOCK_DGRAM = 0x2 - SOCK_NONBLOCK = 0x800 - SOCK_STREAM = 0x1 - SOL_SOCKET = 0x1 - SO_ACCEPTCONN = 0x1e - SO_ATTACH_BPF = 0x32 - SO_ATTACH_REUSEPORT_CBPF = 0x33 - SO_ATTACH_REUSEPORT_EBPF = 0x34 - SO_BINDTODEVICE = 0x19 - SO_BINDTOIFINDEX = 0x3e - SO_BPF_EXTENSIONS = 0x30 - SO_BROADCAST = 0x6 - SO_BSDCOMPAT = 0xe - SO_BUF_LOCK = 0x48 - SO_BUSY_POLL = 0x2e - SO_BUSY_POLL_BUDGET = 0x46 - SO_CNX_ADVICE = 0x35 - SO_COOKIE = 0x39 - SO_DETACH_REUSEPORT_BPF = 0x44 - SO_DEVMEM_DMABUF = 0x4f - SO_DEVMEM_DONTNEED = 0x50 - SO_DEVMEM_LINEAR = 0x4e - SO_DOMAIN = 0x27 - SO_DONTROUTE = 0x5 - SO_ERROR = 0x4 - SO_INCOMING_CPU = 0x31 - SO_INCOMING_NAPI_ID = 0x38 - SO_KEEPALIVE = 0x9 - SO_LINGER = 0xd - SO_LOCK_FILTER = 0x2c - SO_MARK = 0x24 - SO_MAX_PACING_RATE = 0x2f - SO_MEMINFO = 0x37 - SO_NETNS_COOKIE = 0x47 - SO_NOFCS = 0x2b - SO_OOBINLINE = 0xa - SO_PASSCRED = 0x10 - SO_PASSPIDFD = 0x4c - SO_PASSRIGHTS = 0x53 - SO_PASSSEC = 0x22 - SO_PEEK_OFF = 0x2a - SO_PEERCRED = 0x11 - SO_PEERGROUPS = 0x3b - SO_PEERPIDFD = 0x4d - SO_PEERSEC = 0x1f - SO_PREFER_BUSY_POLL = 0x45 - SO_PROTOCOL = 0x26 - SO_RCVBUF = 0x8 - SO_RCVBUFFORCE = 0x21 - SO_RCVLOWAT = 0x12 - SO_RCVMARK = 0x4b - SO_RCVPRIORITY = 0x52 - SO_RCVTIMEO = 0x14 - SO_RCVTIMEO_NEW = 0x42 - SO_RCVTIMEO_OLD = 0x14 - SO_RESERVE_MEM = 0x49 - SO_REUSEADDR = 0x2 - SO_REUSEPORT = 0xf - SO_RXQ_OVFL = 0x28 - SO_SECURITY_AUTHENTICATION = 0x16 - SO_SECURITY_ENCRYPTION_NETWORK = 0x18 - SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 - SO_SELECT_ERR_QUEUE = 0x2d - SO_SNDBUF = 0x7 - SO_SNDBUFFORCE = 0x20 - SO_SNDLOWAT = 0x13 - SO_SNDTIMEO = 0x15 - SO_SNDTIMEO_NEW = 0x43 - SO_SNDTIMEO_OLD = 0x15 - SO_TIMESTAMPING = 0x25 - SO_TIMESTAMPING_NEW = 0x41 - SO_TIMESTAMPING_OLD = 0x25 - SO_TIMESTAMPNS = 0x23 - SO_TIMESTAMPNS_NEW = 0x40 - SO_TIMESTAMPNS_OLD = 0x23 - SO_TIMESTAMP_NEW = 0x3f - SO_TXREHASH = 0x4a - SO_TXTIME = 0x3d - SO_TYPE = 0x3 - SO_WIFI_STATUS = 0x29 - SO_ZEROCOPY = 0x3c - TAB1 = 0x800 - TAB2 = 0x1000 - TAB3 = 0x1800 - TABDLY = 0x1800 - TCFLSH = 0x540b - TCGETA = 0x5405 - TCGETS = 0x5401 - TCGETS2 = 0x802c542a - TCGETX = 0x5432 - TCSAFLUSH = 0x2 - TCSBRK = 0x5409 - TCSBRKP = 0x5425 - TCSETA = 0x5406 - TCSETAF = 0x5408 - TCSETAW = 0x5407 - TCSETS = 0x5402 - TCSETS2 = 0x402c542b - TCSETSF = 0x5404 - TCSETSF2 = 0x402c542d - TCSETSW = 0x5403 - TCSETSW2 = 0x402c542c - TCSETX = 0x5433 - TCSETXF = 0x5434 - TCSETXW = 0x5435 - TCXONC = 0x540a - TFD_CLOEXEC = 0x80000 - TFD_NONBLOCK = 0x800 - TIOCCBRK = 0x5428 - TIOCCONS = 0x541d - TIOCEXCL = 0x540c - TIOCGDEV = 0x80045432 - TIOCGETD = 0x5424 - TIOCGEXCL = 0x80045440 - TIOCGICOUNT = 0x545d - TIOCGISO7816 = 0x80285442 - TIOCGLCKTRMIOS = 0x5456 - TIOCGPGRP = 0x540f - TIOCGPKT = 0x80045438 - TIOCGPTLCK = 0x80045439 - TIOCGPTN = 0x80045430 - TIOCGPTPEER = 0x5441 - TIOCGRS485 = 0x542e - TIOCGSERIAL = 0x541e - TIOCGSID = 0x5429 - TIOCGSOFTCAR = 0x5419 - TIOCGWINSZ = 0x5413 - TIOCINQ = 0x541b - TIOCLINUX = 0x541c - TIOCMBIC = 0x5417 - TIOCMBIS = 0x5416 - TIOCMGET = 0x5415 - TIOCMIWAIT = 0x545c - TIOCMSET = 0x5418 - TIOCM_CAR = 0x40 - TIOCM_CD = 0x40 - TIOCM_CTS = 0x20 - TIOCM_DSR = 0x100 - TIOCM_RI = 0x80 - TIOCM_RNG = 0x80 - TIOCM_SR = 0x10 - TIOCM_ST = 0x8 - TIOCNOTTY = 0x5422 - TIOCNXCL = 0x540d - TIOCOUTQ = 0x5411 - TIOCPKT = 0x5420 - TIOCSBRK = 0x5427 - TIOCSCTTY = 0x540e - TIOCSERCONFIG = 0x5453 - TIOCSERGETLSR = 0x5459 - TIOCSERGETMULTI = 0x545a - TIOCSERGSTRUCT = 0x5458 - TIOCSERGWILD = 0x5454 - TIOCSERSETMULTI = 0x545b - TIOCSERSWILD = 0x5455 - TIOCSER_TEMT = 0x1 - TIOCSETD = 0x5423 - TIOCSIG = 0x40045436 - TIOCSISO7816 = 0xc0285443 - TIOCSLCKTRMIOS = 0x5457 - TIOCSPGRP = 0x5410 - TIOCSPTLCK = 0x40045431 - TIOCSRS485 = 0x542f - TIOCSSERIAL = 0x541f - TIOCSSOFTCAR = 0x541a - TIOCSTI = 0x5412 - TIOCSWINSZ = 0x5414 - TIOCVHANGUP = 0x5437 - TOSTOP = 0x100 - TUNATTACHFILTER = 0x401054d5 - TUNDETACHFILTER = 0x401054d6 - TUNGETDEVNETNS = 0x54e3 - TUNGETFEATURES = 0x800454cf - TUNGETFILTER = 0x801054db - TUNGETIFF = 0x800454d2 - TUNGETSNDBUF = 0x800454d3 - TUNGETVNETBE = 0x800454df - TUNGETVNETHDRSZ = 0x800454d7 - TUNGETVNETLE = 0x800454dd - TUNSETCARRIER = 0x400454e2 - TUNSETDEBUG = 0x400454c9 - TUNSETFILTEREBPF = 0x800454e1 - TUNSETGROUP = 0x400454ce - TUNSETIFF = 0x400454ca - TUNSETIFINDEX = 0x400454da - TUNSETLINK = 0x400454cd - TUNSETNOCSUM = 0x400454c8 - TUNSETOFFLOAD = 0x400454d0 - TUNSETOWNER = 0x400454cc - TUNSETPERSIST = 0x400454cb - TUNSETQUEUE = 0x400454d9 - TUNSETSNDBUF = 0x400454d4 - TUNSETSTEERINGEBPF = 0x800454e0 - TUNSETTXFILTER = 0x400454d1 - TUNSETVNETBE = 0x400454de - TUNSETVNETHDRSZ = 0x400454d8 - TUNSETVNETLE = 0x400454dc - UBI_IOCATT = 0x40186f40 - UBI_IOCDET = 0x40046f41 - UBI_IOCEBCH = 0x40044f02 - UBI_IOCEBER = 0x40044f01 - UBI_IOCEBISMAP = 0x80044f05 - UBI_IOCEBMAP = 0x40084f03 - UBI_IOCEBUNMAP = 0x40044f04 - UBI_IOCMKVOL = 0x40986f00 - UBI_IOCRMVOL = 0x40046f01 - UBI_IOCRNVOL = 0x51106f03 - UBI_IOCRPEB = 0x40046f04 - UBI_IOCRSVOL = 0x400c6f02 - UBI_IOCSETVOLPROP = 0x40104f06 - UBI_IOCSPEB = 0x40046f05 - UBI_IOCVOLCRBLK = 0x40804f07 - UBI_IOCVOLRMBLK = 0x4f08 - UBI_IOCVOLUP = 0x40084f00 - VDISCARD = 0xd - VEOF = 0x4 - VEOL = 0xb - VEOL2 = 0x10 - VMIN = 0x6 - VREPRINT = 0xc - VSTART = 0x8 - VSTOP = 0x9 - VSUSP = 0xa - VSWTC = 0x7 - VT1 = 0x4000 - VTDLY = 0x4000 - VTIME = 0x5 - VWERASE = 0xe - WDIOC_GETBOOTSTATUS = 0x80045702 - WDIOC_GETPRETIMEOUT = 0x80045709 - WDIOC_GETSTATUS = 0x80045701 - WDIOC_GETSUPPORT = 0x80285700 - WDIOC_GETTEMP = 0x80045703 - WDIOC_GETTIMELEFT = 0x8004570a - WDIOC_GETTIMEOUT = 0x80045707 - WDIOC_KEEPALIVE = 0x80045705 - WDIOC_SETOPTIONS = 0x80045704 - WORDSIZE = 0x40 - XCASE = 0x4 - XTABS = 0x1800 - _HIDIOCGRAWNAME = 0x80804804 - _HIDIOCGRAWPHYS = 0x80404805 - _HIDIOCGRAWUNIQ = 0x80404808 + B1000000 = 0x1008 + B115200 = 0x1002 + B1152000 = 0x1009 + B1500000 = 0x100a + B2000000 = 0x100b + B230400 = 0x1003 + B2500000 = 0x100c + B3000000 = 0x100d + B3500000 = 0x100e + B4000000 = 0x100f + B460800 = 0x1004 + B500000 = 0x1005 + B57600 = 0x1001 + B576000 = 0x1006 + B921600 = 0x1007 + BLKALIGNOFF = 0x127a + BLKBSZGET = 0x80081270 + BLKBSZSET = 0x40081271 + BLKDISCARD = 0x1277 + BLKDISCARDZEROES = 0x127c + BLKFLSBUF = 0x1261 + BLKFRAGET = 0x1265 + BLKFRASET = 0x1264 + BLKGETDISKSEQ = 0x80081280 + BLKGETSIZE = 0x1260 + BLKGETSIZE64 = 0x80081272 + BLKIOMIN = 0x1278 + BLKIOOPT = 0x1279 + BLKPBSZGET = 0x127b + BLKRAGET = 0x1263 + BLKRASET = 0x1262 + BLKROGET = 0x125e + BLKROSET = 0x125d + BLKROTATIONAL = 0x127e + BLKRRPART = 0x125f + BLKSECDISCARD = 0x127d + BLKSECTGET = 0x1267 + BLKSECTSET = 0x1266 + BLKSSZGET = 0x1268 + BLKZEROOUT = 0x127f + BOTHER = 0x1000 + BS1 = 0x2000 + BSDLY = 0x2000 + CBAUD = 0x100f + CBAUDEX = 0x1000 + CIBAUD = 0x100f0000 + CLOCAL = 0x800 + CR1 = 0x200 + CR2 = 0x400 + CR3 = 0x600 + CRDLY = 0x600 + CREAD = 0x80 + CS6 = 0x10 + CS7 = 0x20 + CS8 = 0x30 + CSIZE = 0x30 + CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 + ECCGETLAYOUT = 0x81484d11 + ECCGETSTATS = 0x80104d12 + ECHOCTL = 0x200 + ECHOE = 0x10 + ECHOK = 0x20 + ECHOKE = 0x800 + ECHONL = 0x40 + ECHOPRT = 0x400 + EFD_CLOEXEC = 0x80000 + EFD_NONBLOCK = 0x800 + EPIOCGPARAMS = 0x80088a02 + EPIOCSPARAMS = 0x40088a01 + EPOLL_CLOEXEC = 0x80000 + EXTPROC = 0x10000 + FF1 = 0x8000 + FFDLY = 0x8000 + FICLONE = 0x40049409 + FICLONERANGE = 0x4020940d + FLUSHO = 0x1000 + FS_IOC_ENABLE_VERITY = 0x40806685 + FS_IOC_GETFLAGS = 0x80086601 + FS_IOC_GET_ENCRYPTION_NONCE = 0x8010661b + FS_IOC_GET_ENCRYPTION_POLICY = 0x400c6615 + FS_IOC_GET_ENCRYPTION_PWSALT = 0x40106614 + FS_IOC_SETFLAGS = 0x40086602 + FS_IOC_SET_ENCRYPTION_POLICY = 0x800c6613 + F_GETLK = 0x5 + F_GETLK64 = 0x5 + F_GETOWN = 0x9 + F_RDLCK = 0x0 + F_SETLK = 0x6 + F_SETLK64 = 0x6 + F_SETLKW = 0x7 + F_SETLKW64 = 0x7 + F_SETOWN = 0x8 + F_UNLCK = 0x2 + F_WRLCK = 0x1 + HIDIOCGRAWINFO = 0x80084803 + HIDIOCGRDESC = 0x90044802 + HIDIOCGRDESCSIZE = 0x80044801 + HIDIOCREVOKE = 0x4004480d + HUPCL = 0x400 + ICANON = 0x2 + IEXTEN = 0x8000 + IN_CLOEXEC = 0x80000 + IN_NONBLOCK = 0x800 + IOCTL_MEI_NOTIFY_GET = 0x80044803 + IOCTL_MEI_NOTIFY_SET = 0x40044802 + IOCTL_VM_SOCKETS_GET_LOCAL_CID = 0x7b9 + IPV6_FLOWINFO_MASK = 0xffffff0f + IPV6_FLOWLABEL_MASK = 0xffff0f00 + ISIG = 0x1 + IUCLC = 0x200 + IXOFF = 0x1000 + IXON = 0x400 + MAP_ANON = 0x20 + MAP_ANONYMOUS = 0x20 + MAP_DENYWRITE = 0x800 + MAP_EXECUTABLE = 0x1000 + MAP_GROWSDOWN = 0x100 + MAP_HUGETLB = 0x40000 + MAP_LOCKED = 0x2000 + MAP_NONBLOCK = 0x10000 + MAP_NORESERVE = 0x4000 + MAP_POPULATE = 0x8000 + MAP_STACK = 0x20000 + MAP_SYNC = 0x80000 + MCL_CURRENT = 0x1 + MCL_FUTURE = 0x2 + MCL_ONFAULT = 0x4 + MEMERASE = 0x40084d02 + MEMERASE64 = 0x40104d14 + MEMGETBADBLOCK = 0x40084d0b + MEMGETINFO = 0x80204d01 + MEMGETOOBSEL = 0x80c84d0a + MEMGETREGIONCOUNT = 0x80044d07 + MEMISLOCKED = 0x80084d17 + MEMLOCK = 0x40084d05 + MEMREAD = 0xc0404d1a + MEMREADOOB = 0xc0104d04 + MEMSETBADBLOCK = 0x40084d0c + MEMUNLOCK = 0x40084d06 + MEMWRITEOOB = 0xc0104d03 + MTDFILEMODE = 0x4d13 + NFDBITS = 0x40 + NLDLY = 0x100 + NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d + NS_GET_MNTNS_ID = 0x8008b705 + NS_GET_NSTYPE = 0xb703 + NS_GET_OWNER_UID = 0xb704 + NS_GET_PARENT = 0xb702 + NS_GET_PID_FROM_PIDNS = 0x8004b706 + NS_GET_PID_IN_PIDNS = 0x8004b708 + NS_GET_TGID_FROM_PIDNS = 0x8004b707 + NS_GET_TGID_IN_PIDNS = 0x8004b709 + NS_GET_USERNS = 0xb701 + OLCUC = 0x2 + ONLCR = 0x4 + OTPERASE = 0x400c4d19 + OTPGETREGIONCOUNT = 0x40044d0e + OTPGETREGIONINFO = 0x400c4d0f + OTPLOCK = 0x800c4d10 + OTPSELECT = 0x80044d0d + O_APPEND = 0x400 + O_ASYNC = 0x2000 + O_CLOEXEC = 0x80000 + O_CREAT = 0x40 + O_DIRECT = 0x4000 + O_DIRECTORY = 0x10000 + O_DSYNC = 0x1000 + O_EXCL = 0x80 + O_FSYNC = 0x101000 + O_LARGEFILE = 0x0 + O_NDELAY = 0x800 + O_NOATIME = 0x40000 + O_NOCTTY = 0x100 + O_NOFOLLOW = 0x20000 + O_NONBLOCK = 0x800 + O_PATH = 0x200000 + O_RSYNC = 0x101000 + O_SYNC = 0x101000 + O_TMPFILE = 0x410000 + O_TRUNC = 0x200 + PARENB = 0x100 + PARODD = 0x200 + PENDIN = 0x4000 + PERF_EVENT_IOC_DISABLE = 0x2401 + PERF_EVENT_IOC_ENABLE = 0x2400 + PERF_EVENT_IOC_ID = 0x80082407 + PERF_EVENT_IOC_MODIFY_ATTRIBUTES = 0x4008240b + PERF_EVENT_IOC_PAUSE_OUTPUT = 0x40042409 + PERF_EVENT_IOC_PERIOD = 0x40082404 + PERF_EVENT_IOC_QUERY_BPF = 0xc008240a + PERF_EVENT_IOC_REFRESH = 0x2402 + PERF_EVENT_IOC_RESET = 0x2403 + PERF_EVENT_IOC_SET_BPF = 0x40042408 + PERF_EVENT_IOC_SET_FILTER = 0x40082406 + PERF_EVENT_IOC_SET_OUTPUT = 0x2405 + PPPIOCATTACH = 0x4004743d + PPPIOCATTCHAN = 0x40047438 + PPPIOCBRIDGECHAN = 0x40047435 + PPPIOCCONNECT = 0x4004743a + PPPIOCDETACH = 0x4004743c + PPPIOCDISCONN = 0x7439 + PPPIOCGASYNCMAP = 0x80047458 + PPPIOCGCHAN = 0x80047437 + PPPIOCGDEBUG = 0x80047441 + PPPIOCGFLAGS = 0x8004745a + PPPIOCGIDLE = 0x8010743f + PPPIOCGIDLE32 = 0x8008743f + PPPIOCGIDLE64 = 0x8010743f + PPPIOCGL2TPSTATS = 0x80487436 + PPPIOCGMRU = 0x80047453 + PPPIOCGRASYNCMAP = 0x80047455 + PPPIOCGUNIT = 0x80047456 + PPPIOCGXASYNCMAP = 0x80207450 + PPPIOCSACTIVE = 0x40107446 + PPPIOCSASYNCMAP = 0x40047457 + PPPIOCSCOMPRESS = 0x4010744d + PPPIOCSDEBUG = 0x40047440 + PPPIOCSFLAGS = 0x40047459 + PPPIOCSMAXCID = 0x40047451 + PPPIOCSMRRU = 0x4004743b + PPPIOCSMRU = 0x40047452 + PPPIOCSNPMODE = 0x4008744b + PPPIOCSPASS = 0x40107447 + PPPIOCSRASYNCMAP = 0x40047454 + PPPIOCSXASYNCMAP = 0x4020744f + PPPIOCUNBRIDGECHAN = 0x7434 + PPPIOCXFERUNIT = 0x744e + PR_SET_PTRACER_ANY = 0xffffffffffffffff + PTP_CLOCK_GETCAPS = 0x80503d01 + PTP_CLOCK_GETCAPS2 = 0x80503d0a + PTP_ENABLE_PPS = 0x40043d04 + PTP_ENABLE_PPS2 = 0x40043d0d + PTP_EXTTS_REQUEST = 0x40103d02 + PTP_EXTTS_REQUEST2 = 0x40103d0b + PTP_MASK_CLEAR_ALL = 0x3d13 + PTP_MASK_EN_SINGLE = 0x40043d14 + PTP_PEROUT_REQUEST = 0x40383d03 + PTP_PEROUT_REQUEST2 = 0x40383d0c + PTP_PIN_SETFUNC = 0x40603d07 + PTP_PIN_SETFUNC2 = 0x40603d10 + PTP_SYS_OFFSET = 0x43403d05 + PTP_SYS_OFFSET2 = 0x43403d0e + PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_BIT = 0x2 + PTRACE_CFI_BRANCH_EXPECTED_LANDING_PAD_STATE = 0x4 + PTRACE_CFI_BRANCH_LANDING_PAD_EN_BIT = 0x0 + PTRACE_CFI_BRANCH_LANDING_PAD_EN_STATE = 0x1 + PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_BIT = 0x1 + PTRACE_CFI_BRANCH_LANDING_PAD_LOCK_STATE = 0x2 + PTRACE_CFI_SHADOW_STACK_EN_BIT = 0x3 + PTRACE_CFI_SHADOW_STACK_EN_STATE = 0x8 + PTRACE_CFI_SHADOW_STACK_LOCK_BIT = 0x4 + PTRACE_CFI_SHADOW_STACK_LOCK_STATE = 0x10 + PTRACE_CFI_SHADOW_STACK_PTR_BIT = 0x5 + PTRACE_CFI_SHADOW_STACK_PTR_STATE = 0x20 + PTRACE_CFI_STATE_INVALID_MASK = 0xffffffffffffffc0 + PTRACE_GETFDPIC = 0x21 + PTRACE_GETFDPIC_EXEC = 0x0 + PTRACE_GETFDPIC_INTERP = 0x1 + RLIMIT_AS = 0x9 + RLIMIT_MEMLOCK = 0x8 + RLIMIT_NOFILE = 0x7 + RLIMIT_NPROC = 0x6 + RLIMIT_RSS = 0x5 + RNDADDENTROPY = 0x40085203 + RNDADDTOENTCNT = 0x40045201 + RNDCLEARPOOL = 0x5206 + RNDGETENTCNT = 0x80045200 + RNDGETPOOL = 0x80085202 + RNDRESEEDCRNG = 0x5207 + RNDZAPENTCNT = 0x5204 + RTC_AIE_OFF = 0x7002 + RTC_AIE_ON = 0x7001 + RTC_ALM_READ = 0x80247008 + RTC_ALM_SET = 0x40247007 + RTC_EPOCH_READ = 0x8008700d + RTC_EPOCH_SET = 0x4008700e + RTC_IRQP_READ = 0x8008700b + RTC_IRQP_SET = 0x4008700c + RTC_PARAM_GET = 0x40187013 + RTC_PARAM_SET = 0x40187014 + RTC_PIE_OFF = 0x7006 + RTC_PIE_ON = 0x7005 + RTC_PLL_GET = 0x80207011 + RTC_PLL_SET = 0x40207012 + RTC_RD_TIME = 0x80247009 + RTC_SET_TIME = 0x4024700a + RTC_UIE_OFF = 0x7004 + RTC_UIE_ON = 0x7003 + RTC_VL_CLR = 0x7014 + RTC_VL_READ = 0x80047013 + RTC_WIE_OFF = 0x7010 + RTC_WIE_ON = 0x700f + RTC_WKALM_RD = 0x80287010 + RTC_WKALM_SET = 0x4028700f + SCM_DEVMEM_DMABUF = 0x4f + SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 + SCM_TIMESTAMPING = 0x25 + SCM_TIMESTAMPING_OPT_STATS = 0x36 + SCM_TIMESTAMPING_PKTINFO = 0x3a + SCM_TIMESTAMPNS = 0x23 + SCM_TS_OPT_ID = 0x51 + SCM_TXTIME = 0x3d + SCM_WIFI_STATUS = 0x29 + SECCOMP_IOCTL_NOTIF_ADDFD = 0x40182103 + SECCOMP_IOCTL_NOTIF_ID_VALID = 0x40082102 + SECCOMP_IOCTL_NOTIF_SET_FLAGS = 0x40082104 + SFD_CLOEXEC = 0x80000 + SFD_NONBLOCK = 0x800 + SIOCATMARK = 0x8905 + SIOCGPGRP = 0x8904 + SIOCGSTAMPNS_NEW = 0x80108907 + SIOCGSTAMP_NEW = 0x80108906 + SIOCINQ = 0x541b + SIOCOUTQ = 0x5411 + SIOCSPGRP = 0x8902 + SOCK_CLOEXEC = 0x80000 + SOCK_DGRAM = 0x2 + SOCK_NONBLOCK = 0x800 + SOCK_STREAM = 0x1 + SOL_SOCKET = 0x1 + SO_ACCEPTCONN = 0x1e + SO_ATTACH_BPF = 0x32 + SO_ATTACH_REUSEPORT_CBPF = 0x33 + SO_ATTACH_REUSEPORT_EBPF = 0x34 + SO_BINDTODEVICE = 0x19 + SO_BINDTOIFINDEX = 0x3e + SO_BPF_EXTENSIONS = 0x30 + SO_BROADCAST = 0x6 + SO_BSDCOMPAT = 0xe + SO_BUF_LOCK = 0x48 + SO_BUSY_POLL = 0x2e + SO_BUSY_POLL_BUDGET = 0x46 + SO_CNX_ADVICE = 0x35 + SO_COOKIE = 0x39 + SO_DETACH_REUSEPORT_BPF = 0x44 + SO_DEVMEM_DMABUF = 0x4f + SO_DEVMEM_DONTNEED = 0x50 + SO_DEVMEM_LINEAR = 0x4e + SO_DOMAIN = 0x27 + SO_DONTROUTE = 0x5 + SO_ERROR = 0x4 + SO_INCOMING_CPU = 0x31 + SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 + SO_KEEPALIVE = 0x9 + SO_LINGER = 0xd + SO_LOCK_FILTER = 0x2c + SO_MARK = 0x24 + SO_MAX_PACING_RATE = 0x2f + SO_MEMINFO = 0x37 + SO_NETNS_COOKIE = 0x47 + SO_NOFCS = 0x2b + SO_OOBINLINE = 0xa + SO_PASSCRED = 0x10 + SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 + SO_PASSSEC = 0x22 + SO_PEEK_OFF = 0x2a + SO_PEERCRED = 0x11 + SO_PEERGROUPS = 0x3b + SO_PEERPIDFD = 0x4d + SO_PEERSEC = 0x1f + SO_PREFER_BUSY_POLL = 0x45 + SO_PROTOCOL = 0x26 + SO_RCVBUF = 0x8 + SO_RCVBUFFORCE = 0x21 + SO_RCVLOWAT = 0x12 + SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 + SO_RCVTIMEO = 0x14 + SO_RCVTIMEO_NEW = 0x42 + SO_RCVTIMEO_OLD = 0x14 + SO_RESERVE_MEM = 0x49 + SO_REUSEADDR = 0x2 + SO_REUSEPORT = 0xf + SO_RXQ_OVFL = 0x28 + SO_SECURITY_AUTHENTICATION = 0x16 + SO_SECURITY_ENCRYPTION_NETWORK = 0x18 + SO_SECURITY_ENCRYPTION_TRANSPORT = 0x17 + SO_SELECT_ERR_QUEUE = 0x2d + SO_SNDBUF = 0x7 + SO_SNDBUFFORCE = 0x20 + SO_SNDLOWAT = 0x13 + SO_SNDTIMEO = 0x15 + SO_SNDTIMEO_NEW = 0x43 + SO_SNDTIMEO_OLD = 0x15 + SO_TIMESTAMPING = 0x25 + SO_TIMESTAMPING_NEW = 0x41 + SO_TIMESTAMPING_OLD = 0x25 + SO_TIMESTAMPNS = 0x23 + SO_TIMESTAMPNS_NEW = 0x40 + SO_TIMESTAMPNS_OLD = 0x23 + SO_TIMESTAMP_NEW = 0x3f + SO_TXREHASH = 0x4a + SO_TXTIME = 0x3d + SO_TYPE = 0x3 + SO_WIFI_STATUS = 0x29 + SO_ZEROCOPY = 0x3c + TAB1 = 0x800 + TAB2 = 0x1000 + TAB3 = 0x1800 + TABDLY = 0x1800 + TCFLSH = 0x540b + TCGETA = 0x5405 + TCGETS = 0x5401 + TCGETS2 = 0x802c542a + TCGETX = 0x5432 + TCSAFLUSH = 0x2 + TCSBRK = 0x5409 + TCSBRKP = 0x5425 + TCSETA = 0x5406 + TCSETAF = 0x5408 + TCSETAW = 0x5407 + TCSETS = 0x5402 + TCSETS2 = 0x402c542b + TCSETSF = 0x5404 + TCSETSF2 = 0x402c542d + TCSETSW = 0x5403 + TCSETSW2 = 0x402c542c + TCSETX = 0x5433 + TCSETXF = 0x5434 + TCSETXW = 0x5435 + TCXONC = 0x540a + TFD_CLOEXEC = 0x80000 + TFD_NONBLOCK = 0x800 + TIOCCBRK = 0x5428 + TIOCCONS = 0x541d + TIOCEXCL = 0x540c + TIOCGDEV = 0x80045432 + TIOCGETD = 0x5424 + TIOCGEXCL = 0x80045440 + TIOCGICOUNT = 0x545d + TIOCGISO7816 = 0x80285442 + TIOCGLCKTRMIOS = 0x5456 + TIOCGPGRP = 0x540f + TIOCGPKT = 0x80045438 + TIOCGPTLCK = 0x80045439 + TIOCGPTN = 0x80045430 + TIOCGPTPEER = 0x5441 + TIOCGRS485 = 0x542e + TIOCGSERIAL = 0x541e + TIOCGSID = 0x5429 + TIOCGSOFTCAR = 0x5419 + TIOCGWINSZ = 0x5413 + TIOCINQ = 0x541b + TIOCLINUX = 0x541c + TIOCMBIC = 0x5417 + TIOCMBIS = 0x5416 + TIOCMGET = 0x5415 + TIOCMIWAIT = 0x545c + TIOCMSET = 0x5418 + TIOCM_CAR = 0x40 + TIOCM_CD = 0x40 + TIOCM_CTS = 0x20 + TIOCM_DSR = 0x100 + TIOCM_RI = 0x80 + TIOCM_RNG = 0x80 + TIOCM_SR = 0x10 + TIOCM_ST = 0x8 + TIOCNOTTY = 0x5422 + TIOCNXCL = 0x540d + TIOCOUTQ = 0x5411 + TIOCPKT = 0x5420 + TIOCSBRK = 0x5427 + TIOCSCTTY = 0x540e + TIOCSERCONFIG = 0x5453 + TIOCSERGETLSR = 0x5459 + TIOCSERGETMULTI = 0x545a + TIOCSERGSTRUCT = 0x5458 + TIOCSERGWILD = 0x5454 + TIOCSERSETMULTI = 0x545b + TIOCSERSWILD = 0x5455 + TIOCSER_TEMT = 0x1 + TIOCSETD = 0x5423 + TIOCSIG = 0x40045436 + TIOCSISO7816 = 0xc0285443 + TIOCSLCKTRMIOS = 0x5457 + TIOCSPGRP = 0x5410 + TIOCSPTLCK = 0x40045431 + TIOCSRS485 = 0x542f + TIOCSSERIAL = 0x541f + TIOCSSOFTCAR = 0x541a + TIOCSTI = 0x5412 + TIOCSWINSZ = 0x5414 + TIOCVHANGUP = 0x5437 + TOSTOP = 0x100 + TUNATTACHFILTER = 0x401054d5 + TUNDETACHFILTER = 0x401054d6 + TUNGETDEVNETNS = 0x54e3 + TUNGETFEATURES = 0x800454cf + TUNGETFILTER = 0x801054db + TUNGETIFF = 0x800454d2 + TUNGETSNDBUF = 0x800454d3 + TUNGETVNETBE = 0x800454df + TUNGETVNETHDRSZ = 0x800454d7 + TUNGETVNETLE = 0x800454dd + TUNSETCARRIER = 0x400454e2 + TUNSETDEBUG = 0x400454c9 + TUNSETFILTEREBPF = 0x800454e1 + TUNSETGROUP = 0x400454ce + TUNSETIFF = 0x400454ca + TUNSETIFINDEX = 0x400454da + TUNSETLINK = 0x400454cd + TUNSETNOCSUM = 0x400454c8 + TUNSETOFFLOAD = 0x400454d0 + TUNSETOWNER = 0x400454cc + TUNSETPERSIST = 0x400454cb + TUNSETQUEUE = 0x400454d9 + TUNSETSNDBUF = 0x400454d4 + TUNSETSTEERINGEBPF = 0x800454e0 + TUNSETTXFILTER = 0x400454d1 + TUNSETVNETBE = 0x400454de + TUNSETVNETHDRSZ = 0x400454d8 + TUNSETVNETLE = 0x400454dc + UBI_IOCATT = 0x40186f40 + UBI_IOCDET = 0x40046f41 + UBI_IOCEBCH = 0x40044f02 + UBI_IOCEBER = 0x40044f01 + UBI_IOCEBISMAP = 0x80044f05 + UBI_IOCEBMAP = 0x40084f03 + UBI_IOCEBUNMAP = 0x40044f04 + UBI_IOCMKVOL = 0x40986f00 + UBI_IOCRMVOL = 0x40046f01 + UBI_IOCRNVOL = 0x51106f03 + UBI_IOCRPEB = 0x40046f04 + UBI_IOCRSVOL = 0x400c6f02 + UBI_IOCSETVOLPROP = 0x40104f06 + UBI_IOCSPEB = 0x40046f05 + UBI_IOCVOLCRBLK = 0x40804f07 + UBI_IOCVOLRMBLK = 0x4f08 + UBI_IOCVOLUP = 0x40084f00 + VDISCARD = 0xd + VEOF = 0x4 + VEOL = 0xb + VEOL2 = 0x10 + VMIN = 0x6 + VREPRINT = 0xc + VSTART = 0x8 + VSTOP = 0x9 + VSUSP = 0xa + VSWTC = 0x7 + VT1 = 0x4000 + VTDLY = 0x4000 + VTIME = 0x5 + VWERASE = 0xe + WDIOC_GETBOOTSTATUS = 0x80045702 + WDIOC_GETPRETIMEOUT = 0x80045709 + WDIOC_GETSTATUS = 0x80045701 + WDIOC_GETSUPPORT = 0x80285700 + WDIOC_GETTEMP = 0x80045703 + WDIOC_GETTIMELEFT = 0x8004570a + WDIOC_GETTIMEOUT = 0x80045707 + WDIOC_KEEPALIVE = 0x80045705 + WDIOC_SETOPTIONS = 0x80045704 + WORDSIZE = 0x40 + XCASE = 0x4 + XTABS = 0x1800 + _HIDIOCGRAWNAME = 0x80804804 + _HIDIOCGRAWPHYS = 0x80404805 + _HIDIOCGRAWUNIQ = 0x80404808 ) // Errors @@ -585,6 +601,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -808,7 +826,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 64347eb3..6e87bd65 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -156,6 +156,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x8008b70d NS_GET_MNTNS_ID = 0x8008b705 NS_GET_NSTYPE = 0xb703 NS_GET_OWNER_UID = 0xb704 @@ -367,6 +368,7 @@ const ( RTC_WKALM_SET = 0x4028700f SCM_DEVMEM_DMABUF = 0x4f SCM_DEVMEM_LINEAR = 0x4e + SCM_INQ = 0x54 SCM_TIMESTAMPING = 0x25 SCM_TIMESTAMPING_OPT_STATS = 0x36 SCM_TIMESTAMPING_PKTINFO = 0x3a @@ -414,6 +416,7 @@ const ( SO_ERROR = 0x4 SO_INCOMING_CPU = 0x31 SO_INCOMING_NAPI_ID = 0x38 + SO_INQ = 0x54 SO_KEEPALIVE = 0x9 SO_LINGER = 0xd SO_LOCK_FILTER = 0x2c @@ -657,6 +660,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x59) EDOTDOT = syscall.Errno(0x49) EDQUOT = syscall.Errno(0x7a) + EFSBADCRC = syscall.Errno(0x4a) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x70) EHOSTUNREACH = syscall.Errno(0x71) EHWPOISON = syscall.Errno(0x85) @@ -880,7 +885,7 @@ var errorList = [...]struct { {114, "EALREADY", "operation already in progress"}, {115, "EINPROGRESS", "operation now in progress"}, {116, "ESTALE", "stale file handle"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 7d719117..7e2b2e8a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -161,6 +161,7 @@ const ( NFDBITS = 0x40 NLDLY = 0x100 NOFLSH = 0x80 + NS_GET_ID = 0x4008b70d NS_GET_MNTNS_ID = 0x4008b705 NS_GET_NSTYPE = 0x2000b703 NS_GET_OWNER_UID = 0x2000b704 @@ -358,6 +359,7 @@ const ( RTC_WKALM_SET = 0x8028700f SCM_DEVMEM_DMABUF = 0x58 SCM_DEVMEM_LINEAR = 0x57 + SCM_INQ = 0x5d SCM_TIMESTAMPING = 0x23 SCM_TIMESTAMPING_OPT_STATS = 0x38 SCM_TIMESTAMPING_PKTINFO = 0x3c @@ -453,6 +455,7 @@ const ( SO_ERROR = 0x1007 SO_INCOMING_CPU = 0x33 SO_INCOMING_NAPI_ID = 0x3a + SO_INQ = 0x5d SO_KEEPALIVE = 0x8 SO_LINGER = 0x80 SO_LOCK_FILTER = 0x28 @@ -694,6 +697,8 @@ const ( EDESTADDRREQ = syscall.Errno(0x27) EDOTDOT = syscall.Errno(0x58) EDQUOT = syscall.Errno(0x45) + EFSBADCRC = syscall.Errno(0x4c) + EFSCORRUPTED = syscall.Errno(0x75) EHOSTDOWN = syscall.Errno(0x40) EHOSTUNREACH = syscall.Errno(0x41) EHWPOISON = syscall.Errno(0x87) @@ -921,7 +926,7 @@ var errorList = [...]struct { {114, "ELIBACC", "can not access a needed shared library"}, {115, "ENOTUNIQ", "name not unique on network"}, {116, "ERESTART", "interrupted system call should be restarted"}, - {117, "EUCLEAN", "structure needs cleaning"}, + {117, "EFSCORRUPTED", "structure needs cleaning"}, {118, "ENOTNAM", "not a XENIX named type file"}, {119, "ENAVAIL", "no XENIX semaphores available"}, {120, "EISNAM", "is a named type file"}, diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index 8935d10a..5788c2a5 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -700,6 +700,23 @@ func EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { + var _p0 unsafe.Pointer + if len(events) > 0 { + _p0 = unsafe.Pointer(&events[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Eventfd(initval uint, flags int) (fd int, err error) { r0, _, e1 := Syscall(SYS_EVENTFD2, uintptr(initval), uintptr(flags), 0) fd = int(r0) @@ -1785,7 +1802,7 @@ func writev(fd int, iovs []Iovec) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { +func preadvSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1802,7 +1819,7 @@ func preadv(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err er // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { +func pwritevSyscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1819,7 +1836,7 @@ func pwritev(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr) (n int, err e // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { +func preadv2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -1836,7 +1853,7 @@ func preadv2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func pwritev2(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { +func pwritev2Syscall(fd int, iovs []Iovec, offs_l uintptr, offs_h uintptr, flags int) (n int, err error) { var _p0 unsafe.Pointer if len(iovs) > 0 { _p0 = unsafe.Pointer(&iovs[0]) @@ -2241,8 +2258,8 @@ func Mseal(b []byte, flags uint) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func setMemPolicy(mode int, mask *CPUSet, size int) (err error) { - _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(unsafe.Pointer(mask)), uintptr(size)) +func setMemPolicy(mode int, mask unsafe.Pointer, size uintptr) (err error) { + _, _, e1 := Syscall(SYS_SET_MEMPOLICY, uintptr(mode), uintptr(mask), uintptr(size)) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go index 4def3e9f..254f3398 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64_64, uintptr(fd), uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go index fef2bc8b..27c05db1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go index a9fd76a8..840d85bf 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go @@ -213,23 +213,6 @@ func sendmsg(s int, msg *Msghdr, flags int) (n int, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN32, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go index 46006502..fe414498 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go index c8987d26..eb358ce0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go index 921f4306..c437622f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset>>32), uintptr(offset), uintptr(length>>32), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go index 44f06782..bc4ca255 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go index e7fa0abf..5051435c 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go index 8c512567..33aa5418 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall9(SYS_FADVISE64, uintptr(fd), 0, uintptr(offset), uintptr(offset>>32), uintptr(length), uintptr(length>>32), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go index 7392fd45..3bef8ef1 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fchown(fd int, uid int, gid int) (err error) { _, _, e1 := Syscall(SYS_FCHOWN, uintptr(fd), uintptr(uid), uintptr(gid)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go index 41180434..fc1bd4e2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go index 40c6ce7a..d78fe7da 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go index 2cfe34ad..76dcf87d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_PWAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go index 61e6f070..2cf020f2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go index 834b8420..52763762 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go @@ -45,23 +45,6 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT -func EpollWait(epfd int, events []EpollEvent, msec int) (n int, err error) { - var _p0 unsafe.Pointer - if len(events) > 0 { - _p0 = unsafe.Pointer(&events[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := Syscall6(SYS_EPOLL_WAIT, uintptr(epfd), uintptr(_p0), uintptr(len(events)), uintptr(msec), 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT - func Fadvise(fd int, offset int64, length int64, advice int) (err error) { _, _, e1 := Syscall6(SYS_FADVISE64, uintptr(fd), uintptr(offset), uintptr(length), uintptr(advice), 0, 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 1851df14..6487475f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), uintptr(offset>>32), 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 0b43c693..f10201da 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index e1ec0dbe..50980475 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 880c6d6e..9de2cbaa 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index 7c8452a6..33c9c3a4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), 0, uintptr(offset), uintptr(offset>>32)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index b8ef95b0..c6b9175a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $4 DATA ·libc_pwrite_trampoline_addr(SB)/4, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_readv_trampoline_addr(SB)/4, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_writev_trampoline_addr(SB)/4, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $4 +DATA ·libc_preadv_trampoline_addr(SB)/4, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $4 +DATA ·libc_pwritev_trampoline_addr(SB)/4, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 2ffdf861..d3410262 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index 2af3b5c7..1be10bb4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index 1da08d52..dea19d54 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index b7a25135..a9fec24d 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index 6e85b0aa..436efb58 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index f15dadf0..441ed4e4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -597,6 +597,30 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_readv(SB) + RET +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_writev(SB) + RET +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_preadv(SB) + RET +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_pwritev(SB) + RET +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_read(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index 28b487df..d801e4b4 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -1633,6 +1633,90 @@ var libc_pwrite_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func read(fd int, p []byte) (n int, err error) { var _p0 unsafe.Pointer if len(p) > 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 1e7f321e..b15cc017 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -498,6 +498,26 @@ TEXT libc_pwrite_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_pwrite_trampoline_addr(SB), RODATA, $8 DATA ·libc_pwrite_trampoline_addr(SB)/8, $libc_pwrite_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_read_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_read(SB) GLOBL ·libc_read_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index aca56ee4..49d1b880 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -463,4 +463,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 2ea1ef58..f11f1de7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -342,6 +342,7 @@ const ( SYS_IO_PGETEVENTS = 333 SYS_RSEQ = 334 SYS_URETPROBE = 335 + SYS_UPROBE = 336 SYS_PIDFD_SEND_SIGNAL = 424 SYS_IO_URING_SETUP = 425 SYS_IO_URING_ENTER = 426 @@ -386,4 +387,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index d22c8af3..bad740b7 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -427,4 +427,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 5ee264ae..fe646d18 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -330,4 +330,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index f9f03ebf..4362f6d5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -306,6 +306,7 @@ const ( SYS_LANDLOCK_CREATE_RULESET = 444 SYS_LANDLOCK_ADD_RULE = 445 SYS_LANDLOCK_RESTRICT_SELF = 446 + SYS_MEMFD_SECRET = 447 SYS_PROCESS_MRELEASE = 448 SYS_FUTEX_WAITV = 449 SYS_SET_MEMPOLICY_HOME_NODE = 450 @@ -326,4 +327,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index 87c2118e..b63d155a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -447,4 +447,8 @@ const ( SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 + SYS_FILE_GETATTR = 4468 + SYS_FILE_SETATTR = 4469 + SYS_LISTNS = 4470 + SYS_RSEQ_SLICE_YIELD = 4471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 391ad102..435d4331 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -377,4 +377,8 @@ const ( SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 + SYS_FILE_GETATTR = 5468 + SYS_FILE_SETATTR = 5469 + SYS_LISTNS = 5470 + SYS_RSEQ_SLICE_YIELD = 5471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 56561577..dcc0468d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -377,4 +377,8 @@ const ( SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 SYS_OPEN_TREE_ATTR = 5467 + SYS_FILE_GETATTR = 5468 + SYS_FILE_SETATTR = 5469 + SYS_LISTNS = 5470 + SYS_RSEQ_SLICE_YIELD = 5471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index 0482b52e..b96f85eb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -447,4 +447,8 @@ const ( SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 SYS_OPEN_TREE_ATTR = 4467 + SYS_FILE_GETATTR = 4468 + SYS_FILE_SETATTR = 4469 + SYS_LISTNS = 4470 + SYS_RSEQ_SLICE_YIELD = 4471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 71806f08..bffa2bd1 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -454,4 +454,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index e35a7105..57bfc6b2 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -426,4 +426,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 2aea4767..750f706d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -426,4 +426,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 6c9bb4e5..303ccbf4 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -331,4 +331,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index 680bc991..5e5dd4cc 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -392,4 +392,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 620f2710..f7c4fb3d 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -374,6 +374,7 @@ const ( SYS_FSMOUNT = 432 SYS_FSPICK = 433 SYS_PIDFD_OPEN = 434 + SYS_CLONE3 = 435 SYS_CLOSE_RANGE = 436 SYS_OPENAT2 = 437 SYS_PIDFD_GETFD = 438 @@ -405,4 +406,8 @@ const ( SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 SYS_OPEN_TREE_ATTR = 467 + SYS_FILE_GETATTR = 468 + SYS_FILE_SETATTR = 469 + SYS_LISTNS = 470 + SYS_RSEQ_SLICE_YIELD = 471 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 45476a73..526a0d5f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -18,6 +18,11 @@ type ( _C_long_long int64 ) +type KernelTimespec struct { + Sec int64 + Nsec int64 +} + type ItimerSpec struct { Interval Timespec Value Timespec @@ -521,6 +526,14 @@ type TCPInfo struct { Total_rto uint16 Total_rto_recoveries uint16 Total_rto_time uint32 + Received_ce uint32 + Delivered_e1_bytes uint32 + Delivered_e0_bytes uint32 + Delivered_ce_bytes uint32 + Received_e1_bytes uint32 + Received_e0_bytes uint32 + Received_ce_bytes uint32 + _ [4]byte } type TCPVegasInfo struct { @@ -586,7 +599,7 @@ const ( SizeofIPv6MTUInfo = 0x20 SizeofICMPv6Filter = 0x20 SizeofUcred = 0xc - SizeofTCPInfo = 0xf8 + SizeofTCPInfo = 0x118 SizeofTCPCCInfo = 0x14 SizeofCanFilter = 0x8 SizeofTCPRepairOpt = 0x8 @@ -1324,7 +1337,7 @@ const ( PERF_RECORD_CGROUP = 0x13 PERF_RECORD_TEXT_POKE = 0x14 PERF_RECORD_AUX_OUTPUT_HW_ID = 0x15 - PERF_RECORD_MAX = 0x16 + PERF_RECORD_MAX = 0x17 PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0x0 PERF_RECORD_KSYMBOL_TYPE_BPF = 0x1 PERF_RECORD_KSYMBOL_TYPE_OOL = 0x2 @@ -3566,7 +3579,7 @@ const ( DEVLINK_ATTR_LINECARD_SUPPORTED_TYPES = 0xae DEVLINK_ATTR_NESTED_DEVLINK = 0xaf DEVLINK_ATTR_SELFTESTS = 0xb0 - DEVLINK_ATTR_MAX = 0xb3 + DEVLINK_ATTR_MAX = 0xb7 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_NONE = 0x0 DEVLINK_DPIPE_FIELD_MAPPING_TYPE_IFINDEX = 0x1 DEVLINK_DPIPE_MATCH_TYPE_FIELD_EXACT = 0x0 @@ -3888,7 +3901,7 @@ const ( ETHTOOL_MSG_PHY_GET = 0x2d ETHTOOL_MSG_TSCONFIG_GET = 0x2e ETHTOOL_MSG_TSCONFIG_SET = 0x2f - ETHTOOL_MSG_USER_MAX = 0x2f + ETHTOOL_MSG_USER_MAX = 0x33 ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3938,7 +3951,7 @@ const ( ETHTOOL_MSG_PHY_NTF = 0x2e ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 - ETHTOOL_MSG_KERNEL_MAX = 0x30 + ETHTOOL_MSG_KERNEL_MAX = 0x36 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 @@ -4867,7 +4880,7 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x151 + NL80211_ATTR_MAX = 0x15c NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 @@ -5082,12 +5095,12 @@ const ( NL80211_ATTR_WOWLAN_TRIGGERS = 0x75 NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED = 0x76 NL80211_ATTR_WPA_VERSIONS = 0x4b - NL80211_AUTHTYPE_AUTOMATIC = 0x8 + NL80211_AUTHTYPE_AUTOMATIC = 0x9 NL80211_AUTHTYPE_FILS_PK = 0x7 NL80211_AUTHTYPE_FILS_SK = 0x5 NL80211_AUTHTYPE_FILS_SK_PFS = 0x6 NL80211_AUTHTYPE_FT = 0x2 - NL80211_AUTHTYPE_MAX = 0x7 + NL80211_AUTHTYPE_MAX = 0x8 NL80211_AUTHTYPE_NETWORK_EAP = 0x3 NL80211_AUTHTYPE_OPEN_SYSTEM = 0x0 NL80211_AUTHTYPE_SAE = 0x4 @@ -5120,7 +5133,7 @@ const ( NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY = 0x3 NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE = 0x5 NL80211_BAND_IFTYPE_ATTR_IFTYPES = 0x1 - NL80211_BAND_IFTYPE_ATTR_MAX = 0xb + NL80211_BAND_IFTYPE_ATTR_MAX = 0xd NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS = 0x7 NL80211_BAND_LC = 0x5 NL80211_BAND_S1GHZ = 0x4 @@ -5255,7 +5268,7 @@ const ( NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d NL80211_CMD_LINKS_REMOVED = 0x9a - NL80211_CMD_MAX = 0x9d + NL80211_CMD_MAX = 0x9f NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5501,7 +5514,7 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x22 + NL80211_FREQUENCY_ATTR_MAX = 0x27 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5766,7 +5779,7 @@ const ( NL80211_PMSR_FTM_CAPA_ATTR_ASAP = 0x1 NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS = 0x6 NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT = 0x7 - NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0xa + NL80211_PMSR_FTM_CAPA_ATTR_MAX = 0x12 NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP = 0x2 NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED = 0xa @@ -5788,7 +5801,7 @@ const ( NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD = 0x4 NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST = 0x6 NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK = 0xc - NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xd + NL80211_PMSR_FTM_REQ_ATTR_MAX = 0xe NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED = 0xb NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP = 0x3 NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES = 0x7 @@ -5806,7 +5819,7 @@ const ( NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON = 0x1 NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST = 0x8 NL80211_PMSR_FTM_RESP_ATTR_LCI = 0x13 - NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x15 + NL80211_PMSR_FTM_RESP_ATTR_MAX = 0x16 NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP = 0x6 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS = 0x3 NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES = 0x4 @@ -5913,7 +5926,7 @@ const ( NL80211_RATE_INFO_HE_RU_ALLOC_52 = 0x1 NL80211_RATE_INFO_HE_RU_ALLOC_996 = 0x5 NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 - NL80211_RATE_INFO_MAX = 0x1d + NL80211_RATE_INFO_MAX = 0x20 NL80211_RATE_INFO_MCS = 0x2 NL80211_RATE_INFO_S1G_MCS = 0x17 NL80211_RATE_INFO_S1G_NSS = 0x18 @@ -6167,7 +6180,7 @@ const ( NL80211_TXRATE_HT = 0x2 NL80211_TXRATE_LEGACY = 0x1 NL80211_TX_RATE_LIMITED = 0x1 - NL80211_TXRATE_MAX = 0x7 + NL80211_TXRATE_MAX = 0xa NL80211_TXRATE_MCS = 0x2 NL80211_TXRATE_VHT = 0x3 NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT = 0x1 @@ -6183,7 +6196,7 @@ const ( NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 - NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 + NL80211_WIPHY_RADIO_ATTR_MAX = 0x5 NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 @@ -6384,3 +6397,79 @@ const ( MPOL_PREFERRED_MANY = 0x5 MPOL_WEIGHTED_INTERLEAVE = 0x6 ) + +const ( + GPIO_V2_GET_LINEINFO_IOCTL = 0xc100b405 + GPIO_V2_GET_LINE_IOCTL = 0xc250b407 + GPIO_V2_LINE_GET_VALUES_IOCTL = 0xc010b40e + GPIO_V2_LINE_SET_VALUES_IOCTL = 0xc010b40f + GPIO_V2_GET_LINEINFO_WATCH_IOCTL = 0xc100b406 + GPIO_GET_LINEINFO_UNWATCH_IOCTL = 0xc004b40c +) +const ( + GPIO_V2_LINE_ATTR_ID_FLAGS = 0x1 + GPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES = 0x2 + GPIO_V2_LINE_ATTR_ID_DEBOUNCE = 0x3 + GPIO_V2_LINE_CHANGED_REQUESTED = 0x1 + GPIO_V2_LINE_CHANGED_RELEASED = 0x2 + GPIO_V2_LINE_CHANGED_CONFIG = 0x3 + GPIO_V2_LINE_EVENT_RISING_EDGE = 0x1 + GPIO_V2_LINE_EVENT_FALLING_EDGE = 0x2 +) + +type GPIOChipInfo struct { + Name [32]byte + Label [32]byte + Lines uint32 +} +type GPIOV2LineValues struct { + Bits uint64 + Mask uint64 +} +type GPIOV2LineAttribute struct { + Id uint32 + _ uint32 + Flags uint64 +} +type GPIOV2LineConfigAttribute struct { + Attr GPIOV2LineAttribute + Mask uint64 +} +type GPIOV2LineConfig struct { + Flags uint64 + Num_attrs uint32 + _ [5]uint32 + Attrs [10]GPIOV2LineConfigAttribute +} +type GPIOV2LineRequest struct { + Offsets [64]uint32 + Consumer [32]byte + Config GPIOV2LineConfig + Num_lines uint32 + Event_buffer_size uint32 + _ [5]uint32 + Fd int32 +} +type GPIOV2LineInfo struct { + Name [32]byte + Consumer [32]byte + Offset uint32 + Num_attrs uint32 + Flags uint64 + Attrs [10]GPIOV2LineAttribute + _ [4]uint32 +} +type GPIOV2LineInfoChanged struct { + Info GPIOV2LineInfo + Timestamp_ns uint64 + Event_type uint32 + _ [5]uint32 +} +type GPIOV2LineEvent struct { + Timestamp_ns uint64 + Id uint32 + Offset uint32 + Seqno uint32 + Line_seqno uint32 + _ [6]uint32 +} diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 485f2d3a..aede1de7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -354,6 +354,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 @@ -703,3 +711,7 @@ type SysvShmDesc struct { _ uint32 _ uint32 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index ecbd1ad8..bb3bc4dc 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -367,6 +367,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -717,3 +725,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 02f0463a..1fdf4c51 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -345,6 +345,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 @@ -697,3 +705,7 @@ type SysvShmDesc struct { _ uint32 _ uint32 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index 6f4d400d..063e6f0b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -346,6 +346,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -696,3 +704,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index cd532cfa..9cf836c7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -347,6 +347,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -697,3 +705,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 41336208..1d222fcb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -350,6 +350,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 @@ -702,3 +710,7 @@ type SysvShmDesc struct { Ctime_high uint16 _ uint16 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index eaa37eb7..912cc4ab 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -349,6 +349,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -699,3 +707,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 98ae6a1e..1e358ef3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -349,6 +349,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -699,3 +707,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index cae19615..df59f32f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -350,6 +350,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 @@ -702,3 +710,7 @@ type SysvShmDesc struct { Ctime_high uint16 _ uint16 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 6ce3b4e0..29355aa0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -357,6 +357,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint32 @@ -710,3 +718,7 @@ type SysvShmDesc struct { _ uint32 _ [4]byte } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index c7429c6a..c6083a15 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -356,6 +356,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -705,3 +713,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 4bf4baf4..6321cc76 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -356,6 +356,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -705,3 +713,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index e9709d70..b44f402f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -374,6 +374,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -784,3 +792,7 @@ const ( RISCV_HWPROBE_KEY_ZICBOZ_BLOCK_SIZE = 0x6 RISCV_HWPROBE_WHICH_CPUS = 0x1 ) + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index fb44268c..b22c795a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -369,6 +369,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -719,3 +727,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x8044b401 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 9c38265c..0b18075b 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -351,6 +351,14 @@ type Taskstats struct { Wpcopy_delay_min uint64 Irq_delay_max uint64 Irq_delay_min uint64 + Cpu_delay_max_ts KernelTimespec + Blkio_delay_max_ts KernelTimespec + Swapin_delay_max_ts KernelTimespec + Freepages_delay_max_ts KernelTimespec + Thrashing_delay_max_ts KernelTimespec + Compact_delay_max_ts KernelTimespec + Wpcopy_delay_max_ts KernelTimespec + Irq_delay_max_ts KernelTimespec } type cpuMask uint64 @@ -700,3 +708,7 @@ type SysvShmDesc struct { _ uint64 _ uint64 } + +const ( + GPIO_GET_CHIPINFO_IOCTL = 0x4044b401 +) diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index 6c955cea..78362156 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1109,17 +1109,53 @@ const ( ) // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. +// +// Go pointers stored in a TrusteeValue must be pinned using [runtime.Pinner] +// for the lifetime of the TrusteeValue. type TrusteeValue uintptr +// TrusteeValueFromString is unsafe and should not be used. +// +// It returns a uintptr containing a reference to newly-allocated memory +// which will be freed by the garbage collector. +// There is no way for the caller to safely reference this memory. +// +// To create a [TrusteeValue] from a string, use: +// +// p, err := windows.UTF16PtrFromString(s) +// if err != nil { +// // handle error +// } +// +// // Pin the string for as long as it is used. +// var pinner runtime.Pinner +// pinner.Pin(p) +// defer pinner.Unpin() +// +// tv := TrusteeValue(unsafe.Pointer(p)) +// +// Deprecated: TrusteeValueFromString is unsafe and should not be used. func TrusteeValueFromString(str string) TrusteeValue { return TrusteeValue(unsafe.Pointer(StringToUTF16Ptr(str))) } + +// TrusteeValueFromSID returns a [TrusteeValue] referencing sid. +// +// The caller must pin sid using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromSID(sid *SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(sid)) } + +// TrusteeValueFromObjectsAndSid returns a [TrusteeValue] referencing objectsAndSid. +// +// The caller must pin objectsAndSid using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromObjectsAndSid(objectsAndSid *OBJECTS_AND_SID) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndSid)) } + +// TrusteeValueFromObjectsAndName returns a [TrusteeValue] referencing objectsAndName. +// +// The caller must pin objectsAndName using a [runtime.Pinner] for the lifetime of the TrusteeValue. func TrusteeValueFromObjectsAndName(objectsAndName *OBJECTS_AND_NAME) TrusteeValue { return TrusteeValue(unsafe.Pointer(objectsAndName)) } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index d7664365..e6966b4c 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -452,6 +452,7 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys RtlInitString(destinationString *NTString, sourceString *byte) = ntdll.RtlInitString //sys NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) = ntdll.NtCreateFile //sys NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) = ntdll.NtCreateNamedPipeFile +//sys NtQueryInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtQueryInformationFile //sys NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtSetInformationFile //sys RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToNtPathName_U_WithStatus //sys RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) = ntdll.RtlDosPathNameToRelativeNtPathName_U_WithStatus @@ -460,6 +461,8 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) = ntdll.NtSetInformationProcess //sys NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) = ntdll.NtQuerySystemInformation //sys NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) = ntdll.NtSetSystemInformation +//sys NtQueryEaFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, returnSingleEntry bool, eaList *byte, eaListLen uint32, eaIndex *uint32, restartScan bool) (ntstatus error) = ntdll.NtQueryEaFile +//sys NtSetEaFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32) (ntstatus error) = ntdll.NtSetEaFile //sys RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) = ntdll.RtlAddFunctionTable //sys RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) = ntdll.RtlDeleteFunctionTable @@ -892,9 +895,13 @@ const socket_error = uintptr(^uint32(0)) //sys MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) = kernel32.MultiByteToWideChar //sys getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) = iphlpapi.GetBestInterfaceEx //sys GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) = iphlpapi.GetIfEntry2Ex +//sys GetIfTable2Ex(level uint32, table **MibIfTable2) (errcode error) = iphlpapi.GetIfTable2Ex //sys GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) = iphlpapi.GetIpForwardEntry2 //sys GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode error) = iphlpapi.GetIpForwardTable2 +//sys GetIpInterfaceEntry(row *MibIpInterfaceRow) (errcode error) = iphlpapi.GetIpInterfaceEntry +//sys GetIpInterfaceTable(family uint16, table **MibIpInterfaceTable) (errcode error) = iphlpapi.GetIpInterfaceTable //sys GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) = iphlpapi.GetUnicastIpAddressEntry +//sys GetUnicastIpAddressTable(family uint16, table **MibUnicastIpAddressTable) (errcode error) = iphlpapi.GetUnicastIpAddressTable //sys FreeMibTable(memory unsafe.Pointer) = iphlpapi.FreeMibTable //sys NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyIpInterfaceChange //sys NotifyRouteChange2(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) = iphlpapi.NotifyRouteChange2 @@ -1693,10 +1700,13 @@ func NewNTUnicodeString(s string) (*NTUnicodeString, error) { if err != nil { return nil, err } - n := uint16(len(s16) * 2) + n := len(s16) * 2 + if n > (1<<16)-1 { + return nil, syscall.EINVAL + } return &NTUnicodeString{ - Length: n - 2, // subtract 2 bytes for the NULL terminator - MaximumLength: n, + Length: uint16(n) - 2, // subtract 2 bytes for the NULL terminator + MaximumLength: uint16(n), Buffer: &s16[0], }, nil } @@ -1718,11 +1728,15 @@ func (s *NTUnicodeString) String() string { // the more common *uint16 string type. func NewNTString(s string) (*NTString, error) { var nts NTString - s8, err := BytePtrFromString(s) + s8, err := ByteSliceFromString(s) if err != nil { return nil, err } - RtlInitString(&nts, s8) + // The source string plus its terminating NUL must fit within MAX_USHORT. + if len(s8) > MAX_USHORT { + return nil, syscall.EINVAL + } + RtlInitString(&nts, &s8[0]) return &nts, nil } diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index d5658a13..75a50b31 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -169,6 +169,7 @@ const ( FORMAT_MESSAGE_ARGUMENT_ARRAY = 8192 FORMAT_MESSAGE_MAX_WIDTH_MASK = 255 + MAX_USHORT = 0xffff MAX_PATH = 260 MAX_LONG_PATH = 32768 @@ -2320,6 +2321,21 @@ type MibIfRow2 struct { OutQLen uint64 } +// MIB_IF_TABLE_LEVEL enumeration from netioapi.h or +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ne-netioapi-mib_if_table_level. +const ( + MibIfTableNormal = 0 + MibIfTableRaw = 1 + MibIfTableNormalWithoutStatistics = 2 +) + +// MibIfTable2 contains a table of logical and physical interface entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_if_table2. +type MibIfTable2 struct { + NumEntries uint32 + Table [1]MibIfRow2 +} + // IP_ADDRESS_PREFIX stores an IP address prefix. See // https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-ip_address_prefix. type IpAddressPrefix struct { @@ -2413,6 +2429,13 @@ type MibUnicastIpAddressRow struct { CreationTimeStamp Filetime } +// MibUnicastIpAddressTable contains a table of unicast IP address entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_unicastipaddress_table. +type MibUnicastIpAddressTable struct { + NumEntries uint32 + Table [1]MibUnicastIpAddressRow +} + const ScopeLevelCount = 16 // MIB_IPINTERFACE_ROW stores interface management information for a particular IP address family on a network interface. @@ -2455,6 +2478,13 @@ type MibIpInterfaceRow struct { DisableDefaultRoutes uint8 } +// MibIpInterfaceTable contains a table of IP interface entries. See +// https://learn.microsoft.com/en-us/windows/win32/api/netioapi/ns-netioapi-mib_ipinterface_table. +type MibIpInterfaceTable struct { + NumEntries uint32 + Table [1]MibIpInterfaceRow +} + // Console related constants used for the mode parameter to SetConsoleMode. See // https://docs.microsoft.com/en-us/windows/console/setconsolemode for details. @@ -3014,8 +3044,10 @@ const ( ) const ( - // FileInformationClass for NtSetInformationFile + // FileInformationClass for NtSetInformationFile/NtQueryInformationFile, see + // https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/ne-wdm-_file_information_class FileBasicInformation = 4 + FileEaInformation = 7 FileRenameInformation = 10 FileDispositionInformation = 13 FilePositionInformation = 14 diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index fe7a4ea1..192d1930 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -188,9 +188,13 @@ var ( procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") procGetIfEntry2Ex = modiphlpapi.NewProc("GetIfEntry2Ex") + procGetIfTable2Ex = modiphlpapi.NewProc("GetIfTable2Ex") procGetIpForwardEntry2 = modiphlpapi.NewProc("GetIpForwardEntry2") procGetIpForwardTable2 = modiphlpapi.NewProc("GetIpForwardTable2") + procGetIpInterfaceEntry = modiphlpapi.NewProc("GetIpInterfaceEntry") + procGetIpInterfaceTable = modiphlpapi.NewProc("GetIpInterfaceTable") procGetUnicastIpAddressEntry = modiphlpapi.NewProc("GetUnicastIpAddressEntry") + procGetUnicastIpAddressTable = modiphlpapi.NewProc("GetUnicastIpAddressTable") procNotifyIpInterfaceChange = modiphlpapi.NewProc("NotifyIpInterfaceChange") procNotifyRouteChange2 = modiphlpapi.NewProc("NotifyRouteChange2") procNotifyUnicastIpAddressChange = modiphlpapi.NewProc("NotifyUnicastIpAddressChange") @@ -424,8 +428,11 @@ var ( procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") + procNtQueryEaFile = modntdll.NewProc("NtQueryEaFile") + procNtQueryInformationFile = modntdll.NewProc("NtQueryInformationFile") procNtQueryInformationProcess = modntdll.NewProc("NtQueryInformationProcess") procNtQuerySystemInformation = modntdll.NewProc("NtQuerySystemInformation") + procNtSetEaFile = modntdll.NewProc("NtSetEaFile") procNtSetInformationFile = modntdll.NewProc("NtSetInformationFile") procNtSetInformationProcess = modntdll.NewProc("NtSetInformationProcess") procNtSetSystemInformation = modntdll.NewProc("NtSetSystemInformation") @@ -1674,6 +1681,14 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { return } +func GetIfTable2Ex(level uint32, table **MibIfTable2) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIfTable2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func GetIpForwardEntry2(row *MibIpForwardRow2) (errcode error) { r0, _, _ := syscall.SyscallN(procGetIpForwardEntry2.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { @@ -1690,6 +1705,22 @@ func GetIpForwardTable2(family uint16, table **MibIpForwardTable2) (errcode erro return } +func GetIpInterfaceEntry(row *MibIpInterfaceRow) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpInterfaceEntry.Addr(), uintptr(unsafe.Pointer(row))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + +func GetIpInterfaceTable(family uint16, table **MibIpInterfaceTable) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetIpInterfaceTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { @@ -1698,6 +1729,14 @@ func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { return } +func GetUnicastIpAddressTable(family uint16, table **MibUnicastIpAddressTable) (errcode error) { + r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressTable.Addr(), uintptr(family), uintptr(unsafe.Pointer(table))) + if r0 != 0 { + errcode = syscall.Errno(r0) + } + return +} + func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsafe.Pointer, initialNotification bool, notificationHandle *Handle) (errcode error) { var _p0 uint32 if initialNotification { @@ -3704,6 +3743,30 @@ func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, i return } +func NtQueryEaFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, returnSingleEntry bool, eaList *byte, eaListLen uint32, eaIndex *uint32, restartScan bool) (ntstatus error) { + var _p0 uint32 + if returnSingleEntry { + _p0 = 1 + } + var _p1 uint32 + if restartScan { + _p1 = 1 + } + r0, _, _ := syscall.SyscallN(procNtQueryEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(_p0), uintptr(unsafe.Pointer(eaList)), uintptr(eaListLen), uintptr(unsafe.Pointer(eaIndex)), uintptr(_p1)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + +func NtQueryInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, outBuffer *byte, outBufferLen uint32, class uint32) (ntstatus error) { + r0, _, _ := syscall.SyscallN(procNtQueryInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), uintptr(class)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { @@ -3720,6 +3783,14 @@ func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInf return } +func NtSetEaFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32) (ntstatus error) { + r0, _, _ := syscall.SyscallN(procNtSetEaFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) + if r0 != 0 { + ntstatus = NTStatus(r0) + } + return +} + func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) if r0 != 0 { diff --git a/vendor/gopkg.in/yaml.v3/README.md b/vendor/gopkg.in/yaml.v3/README.md deleted file mode 100644 index 08eb1bab..00000000 --- a/vendor/gopkg.in/yaml.v3/README.md +++ /dev/null @@ -1,150 +0,0 @@ -# YAML support for the Go language - -Introduction ------------- - -The yaml package enables Go programs to comfortably encode and decode YAML -values. It was developed within [Canonical](https://www.canonical.com) as -part of the [juju](https://juju.ubuntu.com) project, and is based on a -pure Go port of the well-known [libyaml](http://pyyaml.org/wiki/LibYAML) -C library to parse and generate YAML data quickly and reliably. - -Compatibility -------------- - -The yaml package supports most of YAML 1.2, but preserves some behavior -from 1.1 for backwards compatibility. - -Specifically, as of v3 of the yaml package: - - - YAML 1.1 bools (_yes/no, on/off_) are supported as long as they are being - decoded into a typed bool value. Otherwise they behave as a string. Booleans - in YAML 1.2 are _true/false_ only. - - Octals encode and decode as _0777_ per YAML 1.1, rather than _0o777_ - as specified in YAML 1.2, because most parsers still use the old format. - Octals in the _0o777_ format are supported though, so new files work. - - Does not support base-60 floats. These are gone from YAML 1.2, and were - actually never supported by this package as it's clearly a poor choice. - -and offers backwards -compatibility with YAML 1.1 in some cases. -1.2, including support for -anchors, tags, map merging, etc. Multi-document unmarshalling is not yet -implemented, and base-60 floats from YAML 1.1 are purposefully not -supported since they're a poor design and are gone in YAML 1.2. - -Installation and usage ----------------------- - -The import path for the package is *gopkg.in/yaml.v3*. - -To install it, run: - - go get gopkg.in/yaml.v3 - -API documentation ------------------ - -If opened in a browser, the import path itself leads to the API documentation: - - - [https://gopkg.in/yaml.v3](https://gopkg.in/yaml.v3) - -API stability -------------- - -The package API for yaml v3 will remain stable as described in [gopkg.in](https://gopkg.in). - - -License -------- - -The yaml package is licensed under the MIT and Apache License 2.0 licenses. -Please see the LICENSE file for details. - - -Example -------- - -```Go -package main - -import ( - "fmt" - "log" - - "gopkg.in/yaml.v3" -) - -var data = ` -a: Easy! -b: - c: 2 - d: [3, 4] -` - -// Note: struct fields must be public in order for unmarshal to -// correctly populate the data. -type T struct { - A string - B struct { - RenamedC int `yaml:"c"` - D []int `yaml:",flow"` - } -} - -func main() { - t := T{} - - err := yaml.Unmarshal([]byte(data), &t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t:\n%v\n\n", t) - - d, err := yaml.Marshal(&t) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- t dump:\n%s\n\n", string(d)) - - m := make(map[interface{}]interface{}) - - err = yaml.Unmarshal([]byte(data), &m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m:\n%v\n\n", m) - - d, err = yaml.Marshal(&m) - if err != nil { - log.Fatalf("error: %v", err) - } - fmt.Printf("--- m dump:\n%s\n\n", string(d)) -} -``` - -This example will generate the following output: - -``` ---- t: -{Easy! {2 [3 4]}} - ---- t dump: -a: Easy! -b: - c: 2 - d: [3, 4] - - ---- m: -map[a:Easy! b:map[c:2 d:[3 4]]] - ---- m dump: -a: Easy! -b: - c: 2 - d: - - 3 - - 4 -``` - diff --git a/vendor/modules.txt b/vendor/modules.txt index c16709bc..f90a6159 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -41,7 +41,7 @@ github.com/clipperhouse/displaywidth # github.com/clipperhouse/uax29/v2 v2.7.0 ## explicit; go 1.18 github.com/clipperhouse/uax29/v2/graphemes -# github.com/dlclark/regexp2/v2 v2.2.1 +# github.com/dlclark/regexp2/v2 v2.7.1 ## explicit; go 1.25 github.com/dlclark/regexp2/v2 github.com/dlclark/regexp2/v2/helpers @@ -52,16 +52,16 @@ github.com/erikgeiser/coninput # github.com/jessevdk/go-flags v1.6.1 ## explicit; go 1.20 github.com/jessevdk/go-flags -# github.com/lucasb-eyer/go-colorful v1.4.0 +# github.com/lucasb-eyer/go-colorful v1.4.1 ## explicit; go 1.12 github.com/lucasb-eyer/go-colorful -# github.com/mattn/go-isatty v0.0.22 -## explicit; go 1.21 +# github.com/mattn/go-isatty v0.0.24 +## explicit; go 1.20 github.com/mattn/go-isatty # github.com/mattn/go-localereader v0.0.1 ## explicit github.com/mattn/go-localereader -# github.com/mattn/go-runewidth v0.0.27 +# github.com/mattn/go-runewidth v0.0.28 ## explicit; go 1.23 github.com/mattn/go-runewidth # github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 @@ -77,25 +77,25 @@ github.com/muesli/termenv # github.com/rivo/uniseg v0.4.7 ## explicit; go 1.18 github.com/rivo/uniseg -# github.com/stretchr/testify v1.12.0 +# github.com/stretchr/testify v1.12.1 ## explicit; go 1.17 github.com/stretchr/testify/assert github.com/stretchr/testify/assert/yaml github.com/stretchr/testify/internal/difflib github.com/stretchr/testify/internal/spew github.com/stretchr/testify/require -# github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e +# github.com/xo/terminfo v1.0.0 ## explicit; go 1.19 github.com/xo/terminfo +# go.yaml.in/yaml/v3 v3.0.5 +## explicit; go 1.16 +go.yaml.in/yaml/v3 # golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b ## explicit; go 1.23.0 -# golang.org/x/sys v0.43.0 +# golang.org/x/sys v0.47.0 ## explicit; go 1.25.0 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/text v0.36.0 +# golang.org/x/text v0.41.0 ## explicit; go 1.25.0 golang.org/x/text/transform -# gopkg.in/yaml.v3 v3.0.1 -## explicit -gopkg.in/yaml.v3